Skip to content

feat: redesign 404 page with error image and fix GitHub Pages routing#810

Open
lenderom wants to merge 1 commit intomainfrom
feat/404-page
Open

feat: redesign 404 page with error image and fix GitHub Pages routing#810
lenderom wants to merge 1 commit intomainfrom
feat/404-page

Conversation

@lenderom
Copy link
Copy Markdown
Member

@lenderom lenderom commented Apr 5, 2026

Summary

  • Redesign the 404 error page with a centered error illustration (error.webp) and improved layout using float-image and intersector shortcodes across all three languages (en, de, fr)
  • Add homepage links to the "go to homepage" bullet point in all languages
  • Fix GitHub Pages 404 routing: replace the Hugo alias-based 404.html (which incorrectly landed under /en/404.html due to defaultContentLanguageInSubdir: true) with a static/404.html that reliably serves from the site root
  • Add center position support for float-image in SCSS

Fixes #717
Fixes #136

…ting

Add error illustration and visual improvements to all three language
versions of the 404 page. Replace the Hugo alias-based 404.html (which
landed under /en/404.html due to defaultContentLanguageInSubdir) with a
static/404.html that reliably serves from the root on GitHub Pages.

Fixes #717
Fixes #136
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Hi there! 👋

Thank you for your contribution to the FIP Guide! 🚀
We appreciate your effort in making rail staff travel information more accessible. 🚄

Checklist before merging:

  • Added a description to the Pull Request
  • Checked the License of new pictures (non-commercial use without attribution)
  • Modified content in English
  • Modified content in German
  • Modified content in French

@lenderom lenderom requested review from MoritzWeber0 and therobrob and removed request for therobrob April 5, 2026 12:25
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 5, 2026

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit 8f9d42b
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/69d2548e74641500076db782
😎 Deploy Preview https://deploy-preview-810--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

}

&--center > figure {
float: none;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the class .m-float-image—center doesn’t contain any floating? Is this the correct use of BEM?

---

Hoppla! Die gesuchte Seite ist nicht verfügbar oder wurde verschoben.
{{% float-image
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to use the float-image partial here or could we use the normal image partial instead? :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm as far as I know there is no way to change the size of an image?
I just wanted to have a centered image which is not 100% size :D

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of a split view instead? On the left site the image, on the right side the text? Right now, some parts of the text are centered, but the last part is left-aligned.

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Desktop this could be a good solution. But I guess we would still have the same issue on mobile...

</noscript>
<script>
(() => {
const supportedLanguages = ["en", "de", "fr"];
Copy link
Copy Markdown
Member

@MoritzWeber0 MoritzWeber0 Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not hard-code the languages and iterative over the site languages instead.

Copy link
Copy Markdown
Member

@MoritzWeber0 MoritzWeber0 Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused this is actually needed, in theory the alias should handle it exactly the same way. It also has a section for 404. There seems to be a regression in hugo that it stopped working, the 404.html is no longer created automatically.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regression was in https://github.com/gohugoio/hugo/releases/v0.155.0, where support for multi-language aliases was added.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was marked as breaking change, but I overlooked it: https://discourse.gohugo.io/t/alias-paths-in-v0-155-0-and-later/56674

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So looks like the old approach via the alias is no longer supported. We should get rid of the 404 section in the alias then.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, the handling was just a bit different. This would be a hotfix for it, without too many changes: #831. What do you think of this approach?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this works, we can also do this :)

Copy link
Copy Markdown
Member

@MoritzWeber0 MoritzWeber0 Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the netlify preview it does, so it should also work in GitHub Pages :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contrast of the image in dark mode is pretty bad.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to change the image :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

404 Page not working Illustration for 404-Page

3 participants