Still problems with 404.html

  • I use the 404.html layout with i18n translations inside, and it is ok, but how do I make them to also populate the breadcrumb entry and page title and head title? All those display only in english everywhere.
  • Also, when a / is in the url pointing to a non existing page, the 404.html is displayed but it’s also breaking all the links (even links in the head, making the styles not fetched anymore).

See this happening here. (and here for the “slash” thing) Repo here.

I tried to override the frontmatter title of the 404.html via a, but layout: 404 does not manage to use the 404.html layout.

Do I have to create a full stand-alone 404.html page for each translations (with no relative links inside then)? I feel this would be a “low tech workaround”, not a proper expected use/behavior of Hugo…

I creted the respective issues here and here but I’m not sure if I’m just doing a wrong use of Hugo, and also if I’m understanding well the documentation.

Anyone has an idea of how to fix this please?
It seems I cannot edit the original post to update the links, so here they are: = ok = “/test/” is prepended to all links inside the page, breaking the navigation and styles.

Here is my repo/branch

I am not seeing this behavior in my projects.
Something seems off with your setup but I do not have the time to debug.

In the source of the above pages links to assets are relative i.e. ./<some-asset>
That is not how .RelPermalink works so I don’t know why you have such links outputted but try using .Permalink instead.

This topic was automatically closed after 26 hours. New replies are no longer allowed.