-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
With defaultContentLanguageInSubdir: true, a 404.html file should be created at the root #5161
Comments
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
Still present in Hugo v0.53. |
temporary workaround: |
I believe this issue is absolutely relevant. You need to use some nasty hacks otherwise. |
Would be nice to know if the "hack" is currently the recommended method to use. |
I think this is not a simple problem that can be addressed with a cp hack. refer to #3075. For example, if I have a site with all English content under /en/ and their Chinese counterparts under /zh/. I personally think this is something need to be addressed by the server, and hugo (as a static site generator) can hardly do anything about it. |
I became aware of this issue today. Actually there is a much simpler way than what was posted above. Generate the project locally and then simply copy the 404.html from the language directory under /static/. The |
I guess this will lead to problems as soon as asset URLs will change? You would need to update your static |
Fair enough @Guite I tested further and found that one can simply set the e.g. I believe that this is a non-issue that it can be closed, since it is dead easy to output the 404 page at the root. cc: @divinerites |
@onedrawingperday where do you define this |
Yes. Simply create a 404.md and include the above in its front matter. |
Nice solution, thank you. |
@bep Can you look into this strange behavior? This has been stale for quite some time but could be fixed in a short time. A similar case worth mentioning is #5160, but for |
For 404 in multilingual site. I have this idea
|
just successfully managed to get a custom multilanguage 404 page to show up in my Vercel deployment with this setup:
|
I summarized three workarounds to this issue in a blog post: Create Top-Level 404 Page for a Multilingual Hugo Site. I hope it will be helpful. |
In the direct relation with #5160 I open this (related ?) issue.
When option defaultContentLanguageInSubdiris set to true, a sitemap.xml file is automagically generated by Hugo at the root of the website, as well as in all language subdirectories.
I propose that the same is done for the 404.html file, which is currently (as of Hugo 0.48) only generated in language subdirectories but not at the root of the website.
See :
https://discourse.gohugo.io/t/404-html-not-generated-on-root-if-defaultcontentlanguageinsubdir-true/14048
The text was updated successfully, but these errors were encountered: