fix: make tag links relative to the root of the page (#8)

Previously when we clicked on a tag link, it would append the path to
where we currently were, e.g. clicking "tag" on a post in the `/posts/`
lists, would send us to `/posts/tags/tag` instead of `/tags/tag`.

This fixes #7.

Co-authored-by: Robert Lützner <robert.luetzner@iternity.com>
This commit is contained in:
Robert Lützner 2023-02-23 20:01:33 +00:00 committed by GitHub
parent 473add39bd
commit 82e5f2ccab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@
{{ with .Params.tags }}
<i data-feather="tag"></i>
{{ range . }}
{{ $href := print (absURL "tags/") (urlize .) }}
{{ $href := print "/tags/" (urlize .) }}
<a class="btn btn-sm btn-outline-dark tag-btn" href="{{ $href }}">{{ . }}</a>
{{ end }}
{{ end }}
{{ end }}