Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2): add Facebook Docusaurus 2 template #2124

Merged
merged 2 commits into from
Dec 15, 2019
Merged

Conversation

yangshun
Copy link
Contributor

Motivation

  • Remove Facebook-specific stuff from the classic template
  • Create a Facebook-specific starter website template

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Run sites locally

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 15, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Dec 15, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 11be4c5

https://deploy-preview-2124--docusaurus-preview.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Dec 15, 2019

Deploy preview for docusaurus-2 ready!

Built with commit 11be4c5

https://deploy-preview-2124--docusaurus-2.netlify.com

@@ -75,6 +79,10 @@ module.exports = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
showLastUpdateAuthor: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe we shouldnt the last updated time & author by default. This slows build down (like a LOT) and I think its nicer to give them an impression that "Wow, docusaurus 2 is fast". For newly init site (and lot of our user) does not use git yet, so they're going to see "Sorry, this requires git" error also. Only if they need it they will need to enable it.

and the editUrl is also pointing to the wrong repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'll remove the last updated time and author display.

and the editUrl is also pointing to the wrong repo.

This is intended to give them the right default value (if they create a website folder at the root of their repo). We don't know their repo so it's never going to be right.

title: This is Document Number 3
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac euismod odio, eu consequat dui. Nullam molestie consectetur risus id imperdiet. Proin sodales ornare turpis, non mollis massa ultricies id. Nam at nibh scelerisque, feugiat ante non, dapibus tortor. Vivamus volutpat diam quis tellus elementum bibendum. Praesent semper gravida velit quis aliquam. Etiam in cursus neque. Nam lectus ligula, malesuada et mauris a, bibendum faucibus mi. Phasellus ut interdum felis. Phasellus in odio pulvinar, porttitor urna eget, fringilla lectus. Aliquam sollicitudin est eros. Mauris consectetur quam vitae mauris interdum hendrerit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any extra information coming from this docs btw ? Like the other docs purpose is to demonstrate MDX, heading, etc. This lorem ipsum can be not super useful btw and just increase few seconds of first build.

I dont know why but I prefer having minimal init site, and make the user think "WOW its so fast !!!!"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I don't mind cleaning up but in a future PR

Copy link
Contributor

@endiliey endiliey Dec 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOps btw just realized its been there since the beginning. You're just making a copy of it for fb template

Maybe time to clean this up (?) wdyt

{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
showLastUpdateAuthor: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@endiliey
Copy link
Contributor

Btw I just realized the only difference is just the copyright. I wonder if we should just strip out the copyright header (babel can do this really well) and only maintain one template. If they choose classic, we just strip out comment

@yangshun
Copy link
Contributor Author

yangshun commented Dec 15, 2019

Btw I just realized the only difference is just the copyright.

No, there's also the FB OSS image logo which I took out from the classic footer. Anyway, I intend to add more FB-specific tooling stuff later (e.g. default Prettier config, the copyright header lint rules). Also potentially add more FB-specific components for all the FB Docusaurus sites.

It will continue to diverge even further after this PR.

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved but definitely something to consider is to just maintain one template. If they choose classic, we just strip out the header comment with terser https://github.com/terser/terser

@endiliey
Copy link
Contributor

ok

@yangshun yangshun merged commit b6315f4 into master Dec 15, 2019
@yangshun yangshun deleted the yangshun/fb-template branch December 15, 2019 09:29
@yangshun yangshun added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants