Skip to content

Tag URL in single page does not match overridden permalink format #322

Open
@madd0

Description

@madd0

I'm migrating an existing website to Hugo and using this theme. Everything is going great, but I found what appears to be a bug in the generation of tag links in single pages.

To prevent dead links, I have customized my tag and category URLs:

[permalinks]
  tags = '/tag/:title/'
  categories = '/category/:title/'

Although category links are generated correctly, and tag links are generated correctly in the sidebar, links under individual posts are not generated according to the configuration.

I looked at the sources and it appears that the issue stems from the post_tags.html:

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

I'm not very familiar with the Hugo programming syntax, but it looks to me like the URL is built using the hard-coded tags path instead of using the permalink built by Hugo, which is apparently what is done for categories:

{{- with $.Site.GetPage (printf "/%s/%s" $taxo $path) }}
	{{- if gt $index 0 }}, {{ end -}}
	<a class="meta__link" href="{{ .RelPermalink }}" rel="category">{{ .Title }}</a>
{{- end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions