1bl4z3r / hermit-V2

Continuing Hermit's legacy to be minimal and fast theme
https://1bl4z3r.github.io/hermit-V2/
MIT License
103 stars 45 forks source link

[BUG] - Demo site doesn't have 404 enabled #65

Closed xuhdev closed 7 months ago

xuhdev commented 7 months ago

Describe the bug

The demo site doesn't have custom 404 enabled, e.g., https://1bl4z3r.github.io/hermit-V2/en/about-hugo/s

I don't know why, as I found the theme by default creates a 404.html file.

1bl4z3r commented 7 months ago

Hi @xuhdev,

I have no idea how to configure 404 redirect on GitHub Pages and documentation for the same is few and far between.

Most I can say is that 404.html should be automatically fetched by Pages and returned when an invalid link is thrown. My own site (which is hosted on GitLab) does this automatically

xuhdev commented 7 months ago

Sorry for not being clear. I was trying to say that 404.html is missing on the demo site. See https://github.com/1bl4z3r/hermit-V2/tree/gh-pages, there's no 404.html.

1bl4z3r commented 7 months ago

I got you. There is no 404.html sitewide, but there is a 404 page in each language section.

en/404.html fr/404.html it/404.html

I have to check if we can put global 404.html or not. Most probably we cannot

1bl4z3r commented 7 months ago

Hi @xuhdev As it turns out, you cannot add a global 404.html in multilingual page, when hosted by GitHub Pages. There is an open issue https://github.com/gohugoio/hugo/issues/5161 Relevant Hugo forum link for the same : https://discourse.gohugo.io/t/global-404-page-for-a-multilingual-site/20979

Applied workaround for now, as when it will be officially supported is not yet known. If you are following the same. Add this to hugo build command. You can use any 404.html from any multilingual directory.

hugo --minify --noBuildLock --ignoreCache --gc --verbose && cp public/en/404.html public/404.html