docs(v2): nudge users to add site to showcase (#3977)

- Add a "Add your site!" button
- Add instructions to add a Docusaurus site to showcase
- ignore prettier formatting errors (as edits are often done through Github interface)
This commit is contained in:
Sébastien Lorber 2020-12-30 17:10:54 +01:00 committed by GitHub
parent d99d53a236
commit cf086abe20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View file

@ -5,8 +5,27 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
/*
* ADD YOUR SITE TO DOCUSAURUS SHOWCASE:
*
* Instructions
* - add your site in the json array below, in alphabetical order of title
* - add a local image preview (decent screenshot of your Docusaurus site)
*
* The image must be added to the Github repository, and use require("image")
*
* Example PR: https://github.com/facebook/docusaurus/pull/3976
*
* If you edit this file through the Github interface, you can:
* - Submit first your users.js edit PR
* - This will create a branch on your Docusaurus fork (usually "patch-1")
* - Go to https://github.com/<username>/docusaurus/tree/<branch>/website/src/data/showcase
* - Drag-and-drop an image here to add it to your existing PR
*
*/
// prettier-ignore
const users = [ const users = [
// Please add in alphabetical order of title.
{ {
title: 'AI-Speaker', title: 'AI-Speaker',
description: 'Local, reliable, fast and private Audio and IoT gate.', description: 'Local, reliable, fast and private Audio and IoT gate.',

View file

@ -17,6 +17,8 @@ import users from '../../data/users';
const TITLE = 'Showcase'; const TITLE = 'Showcase';
const DESCRIPTION = const DESCRIPTION =
'See the awesome websites people are building with Docusaurus'; 'See the awesome websites people are building with Docusaurus';
const EDIT_URL =
'https://github.com/facebook/docusaurus/edit/master/website/src/data/users.js';
function Showcase() { function Showcase() {
return ( return (
@ -25,6 +27,14 @@ function Showcase() {
<div className="text--center margin-bottom--xl"> <div className="text--center margin-bottom--xl">
<h1>{TITLE}</h1> <h1>{TITLE}</h1>
<p>{DESCRIPTION}</p> <p>{DESCRIPTION}</p>
<p>
<a
className={'button button--primary'}
href={EDIT_URL}
target={'_blank'}>
Add your site!
</a>
</p>
</div> </div>
<div className="row"> <div className="row">
{users.map((user) => ( {users.map((user) => (