How to use relative URLs?

Every url is relative except this in the screenshot.

<a href="">Demo</a>

How to achieve

<a href="/docs/architecture/demo/">Demo</a>

Our config is

The relative URL is desired because htmlproofer is enabled for every pull request.

html-proofer will fail if the page is introduced in the PR.

  • ./public/docs/architecture/demo/index.html

Because Hugo renders the html with the baseURL, it will be treated as an external link.
The external link returns 404 because it is not deployed yet.

I tried with relativeURLs: true and it does not work.
Also tried with baseURL: "" and it seems make some intended external links broken.

It looks like the theme you are using calls the .Permalink to render the breadcrumbs.

Try to overwrite this to use .RelPermalink instead.

Thanks for the direction.
Found the solution
baseURL: “/”

in the docsy theme example docsy-example/config.toml at master · google/docsy-example · GitHub

Thanks @pointyfar for the direction.