-
-
Notifications
You must be signed in to change notification settings - Fork 22
feat: redesign 404 page with error image and fix GitHub Pages routing #810
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The contrast of the image in dark mode is pretty bad.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feel free to change the image :) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,12 +4,20 @@ params: | |
| pagefind_ignore: true | ||
| --- | ||
|
|
||
| Hoppla! Die gesuchte Seite ist nicht verfügbar oder wurde verschoben. | ||
| {{% float-image | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? :)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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... |
||
| src="error.webp" | ||
| height="50%" | ||
| position="center" | ||
| /%}} | ||
|
|
||
| <p style="text-align: center;">Hoppla! Die gesuchte Seite ist nicht verfügbar oder wurde verschoben.</p> | ||
|
|
||
| {{% intersector %}} | ||
|
|
||
| Probiere folgende Dinge: | ||
|
|
||
| - **URL überprüfen:** Stelle sicher, dass die Adresse keine Tippfehler enthält. | ||
| - **Zur Startseite:** Kehre zur Startseite zurück und navigiere von dort aus. | ||
| - **Zur Startseite:** Kehre zur [Startseite](/) zurück und navigiere von dort aus. | ||
| - **Navigation nutzen:** Nutze das Menü oder die Suchfunktion. | ||
| - **Kontaktiere uns:** Bei Fragen oder Problemen kannst du dich gerne an uns wenden: [nextstop@fipguide.org](mailto:nextstop@fipguide.org) | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this works, we can also do this :)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <head> | ||
| <title>404 – Page not found</title> | ||
| <meta name="robots" content="noindex" /> | ||
| <meta charset="utf-8" /> | ||
| <noscript> | ||
| <meta http-equiv="refresh" content="0; url=/en/404/" /> | ||
| </noscript> | ||
| <script> | ||
| (() => { | ||
| const supportedLanguages = ["en", "de", "fr"]; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| const defaultLanguage = "en"; | ||
|
|
||
| const getTargetLanguage = () => { | ||
| const nav = window.navigator; | ||
| if (!Array.isArray(nav.languages)) { | ||
| return defaultLanguage; | ||
| } | ||
|
|
||
| for (const language of nav.languages) { | ||
| for (const lang of supportedLanguages) { | ||
| if (language.toLowerCase().includes(lang)) { | ||
| return lang; | ||
| } | ||
| } | ||
| } | ||
| return defaultLanguage; | ||
| }; | ||
|
|
||
| window.location.replace(`/${getTargetLanguage()}/404/`); | ||
| })(); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <h1>Rerouting</h1> | ||
| <p> | ||
| You should be rerouted in a second, if not, | ||
| <a href="/en/404/">click here</a>. | ||
| </p> | ||
| </body> | ||
| </html> | ||

There was a problem hiding this comment.
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?