Skip to content

Broken "affected" links if baseURL contains non-root path #251

@zeeZ

Description

@zeeZ

Describe the bug
Hello, it's me again with an issue similar to #126 😄.
With a config such as baseURL: http://example.com/foo/ links for affected services are broken because they again begin with /.

I've narrowed it down to a change introduced in Hugo v0.101.0 (gohugoio/hugo@a5a4422) that now treats all URLs beginning with a / as relative to the root, not to the baseURL.

Reproduction steps
Steps to reproduce the behavior:

  1. cd exampleSite && hugo serve --baseUrl=http://localhost/cstate/ --theme=cstate --themesDir=../.. --verbose
  2. Open http://localhost:1313/cstate/ in browser
  3. Notice broken links up top for affected services (Gateway, Website, API...) both on the main page and from the little tags on individual issues.

I still have the GitLab mirror for the dev branch, currently built with Hugo v0.104.3, up at https://kurisuchan.gitlab.io/cstate/ that shows the same behavior

Context
cstate: master (8af8ff5)
hugo: v0.105.0

Additional information
Replacing /affected/... with affected/... seems to do the trick. I have a branch with those changes at zeeZ@0727f66 and could create a PR if wanted, just need a new dev branch. I've tried the change with some older versions down to v0.80.0 and nothing seems to break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions