Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

href's in list of tags in _default/single.html footer section incorrect #38

Open
ranger6 opened this issue Jul 30, 2021 · 0 comments
Open

Comments

@ranger6
Copy link

ranger6 commented Jul 30, 2021

The template code to generate a list of tags with hrefs to each tag's definition fails when the baseURL contains a path component. That is, everything is fine if the baseURL is https://example.com/ but fails if the baseURL is https://example.com/site/. This appears to be caused by not using the "relLangURL" (or "relURL") function to form the href. In other parts of the theme, this function is used and results are correct.

In code, the faulty line is:

<a class="tag" href="/tags/{{ . | urlize }}">#{{.}}</a>

A working version would be:

<a class="tag" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">#{{.}}</a>

To Reproduce

Set up the example Noteworthy theme site and set the baseURL in config.toml to something with a path component. The bug appears when running hugo server and when publishing, for example, to GitHub Pages. The example is available at https://github.com/ranger6/noteworthy-example. The master branch contains a forked and unmodified submodule of the Noteworthy Theme: https://github.com/ranger6/hugo-theme-noteworthy. The GitHub Pages for the noteworthy-example demonstrates the bug: https://ranger6.github.io/noteworthy-example/

To Fix

The above mentioned single.html file needs the appropriate changes applied.

Pull request to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant