The Wayback Machine - https://web.archive.org/web/20260215173620/https://github.com/gohugoio/hugo/issues/14388
Skip to content

hugolib: Fix multilingual single-host alias generation #14388

@jmooring

Description

@jmooring

While PR #14386 corrected alias publication paths for monolingual and multilingual multihost configurations, multilingual single-host sites still exhibit incorrect alias publication paths under certain conditions.

  1. When an alias path in front matter is absolute, the alias is incorrectly published relative to the publishDir. It should be published relative to the site root.

    content path front matter alias expected publication path actual publication path
    content/fr/foo/s1/p1.md /p1-alias public/fr/my-alias/index.html public/my-alias/index.html

    That means, for example, that aliases for French content are clobbered by aliases for German content. Yes, this is a breaking change, but what we have is already broken.

  2. When an output format has a non-empty path parameter, the path directory is incorrectly created in the root of the publishDir. It should be published in the site root. Consider an output format where the path is set to print:

    content path front matter alias expected publication path actual publication path
    content/fr/foo/s1/p1.md p1-alias public/fr/print/foo/s1/p1-alias/index.html public/print/fr/foo/s1/p1-alias/index.html

Note

As of v0.153.0, the site root may be composed of language, role, and/or version. For example, public/guest/v1.0.0/fr.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions