Add 404 error page and update book configuration#3125
Add 404 error page and update book configuration#3125yl275 wants to merge 1 commit intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
I haven't tested this myself, but what you write makes sense: we extract text from the book "chapters", which are the files mentioned in To improve upon this, I think we would need to add code in mdbook-i18n-helpers to detect the We would then also need to test if the page can be translated later...
Yes, I think this looks like a great approach! I don't have a lot of time to really test this out right now, but it looks like a nice approach to me. |
This PR adds a small JavaScript snippet to
404.md, so that when a user visits a broken link under a translated version of the book (for example/es/does-not-exist.html), they are redirected to the corresponding language-specific 404 page (/es/404.html,/zh-CN/404.html, etc.) instead of the English 404.I tested this, but it seems that
404.mdis not going through the translation pipeline.Am I on the right track with this approach?
fixes #2022