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): allow home page for docs #2652

Merged
merged 7 commits into from May 17, 2020
Merged

feat(v2): allow home page for docs #2652

merged 7 commits into from May 17, 2020

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Apr 24, 2020

Motivation

I am really excited to close all three of the listed PRs, finally this issue, which our users constantly mention, will be closed! 😝

Resolve #2507
Resolve #2567
Resolve #1973

Related issue on Canny - https://docusaurus.canny.io/admin/board/feature-requests/p/home-page-for-docs

Yes, indeed, although there are not many changes, the complexity of the code increases, but this is all because to cover all use cases:

  • Docs without versioning
  • Docs with versioning
  • Docs-only mode
  • Using existing document as home page
  • Using special-purpose document (default is "_index") as home page
  • Possibility to have the own docs page (thereby override the default home page, this may be useful in versioning docs)

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

See docs and preview (eg. https://deploy-preview-2652--docusaurus-2.netlify.app/docs/)

P.S. You can see in snapshots diff that the sorting of routes has been changed, that's actually how it should be (so you don't have to worry about that).

// Sort the route config. This ensures that route with nested
// routes are always placed last.
sortConfig(pluginsRouteConfigs);

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.)

@lex111 lex111 added the pr: new feature This PR adds a new API or behavior. label Apr 24, 2020
@lex111 lex111 requested a review from yangshun April 24, 2020 17:03
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 24, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 92d16c7

https://deploy-preview-2652--docusaurus-2.netlify.app

@lex111
Copy link
Contributor Author

lex111 commented Apr 24, 2020

It is strange why Travis CI fails, I have everything OK on my local machine.
@yangshun could please you force it to restart?

It's all right.

@facebook facebook deleted a comment from docusaurus-bot Apr 24, 2020
@lex111
Copy link
Contributor Author

lex111 commented Apr 25, 2020

Again, there seems to be a problem with snapshots being different in local (dev) and test (CI) environments. I take it this is due to the asynchronous processing of routes, perhaps it is worth sorting routes to achieve the same result?

@lex111
Copy link
Contributor Author

lex111 commented Apr 26, 2020

Even in my fork, tests with changes to this PR successfully pass. I can’t understand why in this (original) repo does not pass the tests.

Test Suites: 47 passed, 47 total
Tests:       267 passed, 267 total
Snapshots:   123 passed, 123 total
Time:        134.669s
Ran all test suites.
Done in 136.01s.

@lex111
Copy link
Contributor Author

lex111 commented Apr 26, 2020

Hell yeah, I added sorting for child routes and tests began to pass for CI. Now we have the same result on all environments.

@lex111 lex111 modified the milestone: v2.0.0-alpha.54 Apr 27, 2020
@lex111 lex111 mentioned this pull request May 5, 2020
@benmccann
Copy link

Thanks for this! Just FYI, this PR will need a rebase

The other thing that will help us a lot with the homepage is #2537

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

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

Should we add this feature into the examples too?

@yangshun yangshun merged commit 00a8e9e into master May 17, 2020
@yangshun yangshun deleted the lex111/docs-route branch May 17, 2020 09:48
@lex111
Copy link
Contributor Author

lex111 commented May 17, 2020

Should we add this feature into the examples too?

Do you mean init template?

@yangshun
Copy link
Contributor

Oh yes the templates. I think we should add useful defaults to the templates.

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: new feature This PR adds a new API or behavior.
Projects
None yet
5 participants