How to use aliases across languages in v0.155.0?

Newly in v0.155, Page aliases are language-relative instead of absolute to the web root. Assume that I have got the document my-page.de.md, which will be rendered to /de/my-page.
Now I have defined in the frontmatter of my-page.de.md: aliases = [“/page-on-root”, “/en/my-page”]. Both the aliases newly do not work any more as expected and instead create the two new pages /de/page-on-root as well as /de/en/my-page.

How would I now create the aliases I had before?
I have found that aliases = [“../page-on-root”, “../en/my-page”] works - is this the way to go? It doesn’t feel very intuitive to me.

We made a breaking change in v0.155.0 that was not described in the release notes. I apologize for the oversight, and will amend the release notes later today.

See https://discourse.gohugo.io/t/alias-paths-in-v0-155-0-and-later/56674.


EDIT: I’ve amended the release notes to note the breaking change.

Thanks for the reply, and thanks for the explanation! It only solves half my problems, though. How would I now create an alias to /page-on-root?

With v0.155.0 and later you cannot create an alias in the server root using the aliases feature. Alias paths starting with a slash (/) resolve to the site root, not to the server root.


Perhaps there’s another way to handle your use case; I’ll give it some thought.

This is the setup and objective, as I understand your use case.

baseURL = 'https://example.org/'
defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = true

[languages.en]
weight = 1
title = "My Site in English"

[languages.de]
weight = 2
title = "Meine Seite auf Deutsch"

content

content/
└── s1/
    └── p1.en.md

desired result

public/
├── alias-to-p1-en/
│   └── index.html
├── de/
│   └── index.html
├── en/
│   ├── s1/
│   │   ├── p1/
│   │   │   └── index.html
│   │   └── index.html
│   └── index.html
└── index.html

Questions:

  1. How many aliases do you need to create in the server root?
  2. Who or what hosts your production site?