facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
55.96k stars 8.4k forks source link

bug (v2) html files with underscore prefix returning 404 #2332

Closed amilajack closed 4 years ago

amilajack commented 4 years ago

šŸ› Bug Report

HTML files in static dir with underscore prefix are not resolved. Page shows Page Not Found. Only resolves underscores when running docusaurus start.

Screen Shot 2020-02-26 at 11 14 25 AM

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Create a new project with docusaurus
  2. add _foo.html to static dir
  3. publish to github pages

Expected behavior

_foo.html page should be resolved. Behavior should be consistent between dev and prod builds.

Actual Behavior

_foo.html page shows Page Not Found

Screen Shot 2020-02-26 at 11 14 25 AM

Your Environment

Reproducible Demo

https://github.com/amilajack/my-website

this works https://github.com/amilajack/my-website/foo.html

this does not work https://github.com/amilajack/my-website/_foo.html

lex111 commented 4 years ago

This is not a Docusaurus bug, if you add the .nojekyll file to the gh-pages branch, this error will disappear.

See:

amilajack commented 4 years ago

@lex111 thanks! Also do you think docusarus should add the .nojekyll file by default?

lex111 commented 4 years ago

@amilajack no, I donā€™t think so, because this is an issue that applies only to GitHub Pages (in this case), and we should not care about this, since our task as a static site generator is to generate the proper build of website.

yangshun commented 4 years ago

This is interesting! While it's not a Docusaurus bug, I recommend we document these weird behaviors down in a new FAQ page or something - maybe https://v2.docusaurus.io/docs/faq? I can think of more stuff to add into it (e.g. some prerendering-related issues).

@amilajack would you be interested in creating one?

Even if we don't add it as an FAQ page on our site, we can create a Stack Overflow question so that the knowledge is shared and people can discover it easily.

amilajack commented 4 years ago

Iā€™d love to document this. I was wondering what the correct place to document this was. I was thinking of adding it to the ā€œpublishing with GitHub pagesā€ section. What are your recommendations?

lex111 commented 4 years ago

I like this idea, it will be more convenient and predictable for users than creating a separate section (FAQs) for this. Although maybe in the future it might be worth writing something like that.

yangshun commented 4 years ago

Adding it to the "Publishing with GitHub pages" section sounds good!