Closed ruskinik closed 7 months ago
Hey @ruskinik, I have added support for language based 404 page. here is the changes https://github.com/zeon-studio/hugoplate/commit/f994a8b6e66e8f751bb789c960ad31a5cc894b98 please download the latest version.
Maybe I'm missing something but it didn't solve the problem.
npm run update-theme
404.en.html
from themes
to layouts
404.fr.html
to layouts
with French 404http://localhost:1313/fr/foo
shows English 404 page.
please start from scratch by re-downloading the theme. and let me know if it works...
On Mon, Apr 15, 2024, 5:48 PM Nikolai @.***> wrote:
Maybe I'm missing something but it didn't solve the problem.
- npm run update-theme
- copied 404.en.html from themes to layouts
- added 404.fr.html to layouts with French 404
http://localhost:1313/fr/foo shows English 404 page.
— Reply to this email directly, view it on GitHub https://github.com/zeon-studio/hugoplate/issues/115#issuecomment-2056637170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOAMCY2U6ZF2ZBHSG75WZ23Y5O475AVCNFSM6AAAAABGGCRIK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJWGYZTOMJXGA . You are receiving this because you commented.Message ID: @.***>
It works, thanks.
However, solving one problem, it created another by changing the URL structure from example.com/foo
to example.com/en/foo
.
Is it possible to keep the default URL structure?
I don't think so, because when you enable defaultContentLanguageInSubdir
it will add the language path to the URL. but still I am going to check if it works
What is your Hugo Extended Version
0.124.1
What is your Go Version
1.21.5
What is your Node.js Version
21.7.3
Check for Existing Issues
Expected Behavior
In
layouts/404.html
I have:In
i18n/en.yaml
:And i18n/fr.yaml:
When we go to, e.g.,
example.com/fr/foo
, the French version is expected but the English one is shown. This is evident from checking the source of the rendered 404 page which haslang="en-us"
or adding{{ .Site.Language.Lang }}
to 404.html and it will returnen
fromexample.com/fr/foo
.Steps to Reproduce
In 404.html
Code Reproduction URL
No response
Additional Information
No response