-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Docs-only mode doesn't work #3567
Comments
Hi, The "docs-only" name may be misleading, but using If you want to disable the blog, pass If you want to keep the blog, the remaining blog posts should not link anymore to Reading the whole error message you'll also notice that there is an option to disable/ignore this log and let the build pass, in case yu can't fix the broken links right now but want to deploy the site with broken links. |
I want to get rid of the landing page and keep the blog. I follow the instructions in https://v2.docusaurus.io/docs/docs-introduction/#docs-only-mode to do that, but clearly they don't work. |
Why should I deploy a site with broken links? |
@tlm28 I don't think @slorber is suggesting you deploy a site with broken links. He is saying you can workaround it short-term, build/load the site and ignore the errors while you work out the issue re: whether you want a blog or not. In other words, I believe he is first asking whether you want to disable the blog or not. And if you don't, you need to set |
We do want to keep the blog. The broken links include paths to docs. Here's the complete list of the errors: Error: Broken links found!
|
@tlm28 I'm sorry, as your error message was incomplete (only showing first errors, related to blog pages), I thought it was related to the blog, but it is probably related to your layout / theme configuration instead, and affect all the pages (not only blog). If you used the Facebook template, you should have this default footer config: You have in practice 2 links to /docs/ and /docs/doc2 from your footer, appearing on all the pages of your site, and those links do not exist anymore because you decided to move The current system is just a failfast way to prevent you from deploying a footer with broken links in production, and ensure you fix those links first, by using footer config such as: {
items: [
{
label: 'Style Guide',
to: '/',
},
{
label: 'Second Doc',
to: '/doc2',
},
],
}, Also, as it's displayed at the very end in the error message (made this message more visible in PR #3569), there an I do not recommend using this unless you have good reasons, as this broken links detection feature actually prevented you from deploying a broken footer that you actually didn't notice. This feature works as intended. I do agree that it may be confusing to have such a verbose error output, but in practice, this is because a broken link is found in ALL pages of your site, due to being part of the site layout. Will try to improve the error message a bit regarding this. |
Thanks @slorber. |
I just ran into this issue and did not find the errors clear because I assumed that the instructions at https://v2.docusaurus.io/docs/docs-introduction/#docs-only-mode would include everything we'd need to do to change to only having docs. Maybe the documentation for docs-only-mode needs to be improved. For example, adding instructions about where we'd need to edit references to Not sure if it's possible, but another alternative would be for the docs plugin to try to account for Edit: For future people using classic, this is what worked for me: items: [
// Remove this item
{
to: 'docs/',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
{
href: 'https://github.com/user_name/repo_name',
label: 'GitHub',
position: 'right',
},
], |
@plocket any doc PR is welcome if you feel you can improve the instructions |
Just wanted to say I had a similar issue, agree updating the docs to mention the footer has to be modified -- if using the template -- would be helpful |
Docs-only mode doesn't work
I ran the following command to install Docusaurus 2.0.0-alpha.65:
$ npx @docusaurus/init@next init website classic
and follow the instructions in
https://v2.docusaurus.io/docs/docs-introduction/#docs-only-mode
to get rid of the landing page:
When I built the site, I get these error messages:
Error: Broken links found!
Page path = /404.html:
-> link to /docs/
-> link to /docs/doc2/
Page path = /blog:
-> link to /docs/
-> link to /docs/doc2/
Page path = /blog/hello-world:
-> link to /docs/
-> link to /docs/doc2/
Page path = /blog/hola:
-> link to /docs/
-> link to /docs/doc2/
Page path = /blog/tags:
-> link to /docs/
-> link to /docs/doc2/
Page path = /blog/tags/docusaurus:
-> link to /docs/
-> link to /docs/doc2/
...
Is this a bug in Docusaurus 2.0.0-alpha.65?
The text was updated successfully, but these errors were encountered: