eclipse-langium / langium-website

Source of langium.org
https://langium.org/
MIT License
14 stars 34 forks source link

Fix 404 page's styling #238

Closed Lotes closed 1 month ago

Lotes commented 3 months ago

Fixes #236

github-actions[bot] commented 3 months ago

PR Preview Action v1.4.6 :---: Preview removed because the pull request was closed. 2024-08-07 06:55 UTC

Lotes commented 3 months ago

This is still draft, because I need to test as a deployment ftm because on local mode it does not show up the custom 404. The problem so far is that the others.html partial includes paths to CSS that are not correct on subpages like "/docs/xxx"...

Lotes commented 3 months ago

Bah, it seems I cannot test it really on a preview server. The 404 page is a result of the HTTP server, which redirects to 404.html (GH-Preview-Pages does not). So what was missing? The base URL T_T... I think when we release the changed flag, it will work. But I definitely cannot test it locally.

Lotes commented 3 months ago

This seems to break the GitHub PR preview: https://eclipse-langium.github.io/langium-previews/pr-previews/pr-238/docs/

True. We need to set the correct base url before we are building. Otherwise it would be https://eclipse-langium.github.io/langium-previews/pr-previews instead of https://eclipse-langium.github.io/langium-previews/pr-previews/pr-xxx.

EDIT: @msujew I tried adding the base URL in the GH Action. But for some reason it seems to use the workflow file from main, not from the branch. Is there any way to test this locally? Do you know something?

montymxb commented 2 months ago

I've peeked at this too and it feels like hugo isn't responding to a myriad of ways to set a custom 404. The usual locations in layout, static, or even modifying the theme don't seem to have effect (notably the theme's own 404 isn't applied as expected). There can be a few reasons for this based on how we've customized the app, but we're also using an older version from about 3 years ago. I'm not sure how easily we could upgrade, but it might be worth checking if some newer version of hugo makes it easier to resolve this.

Lotes commented 1 month ago

I am closing this PR. No idea how to check this, without breaking something.