diff options
author | briggySmalls <briggySmalls90@gmail.com> | 2020-02-10 02:24:05 +0300 |
---|---|---|
committer | briggySmalls <briggySmalls90@gmail.com> | 2020-02-10 02:24:05 +0300 |
commit | ad2f85017f1a28a725e132ecf86181fbce0337de (patch) | |
tree | bc64625daa7cbcfede7ca71fce696cc00b4ca1a9 /layouts | |
parent | f44f118c48a5b66797d43c36757944cb7b51901d (diff) |
Ensure tag links are relative
Used the following discourse link for reference:
https://discourse.gohugo.io/t/how-to-get-permalink-of-taxonomies-in-templates/12927/15
Diffstat (limited to 'layouts')
-rwxr-xr-x | layouts/posts/single.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 0964b45..c072b85 100755 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -1,17 +1,17 @@ {{ define "section_content" }} <div class="section" id="content"> {{ .Date.Format (.Site.Params.dateForm | default "Mon Jan 02, 2006") }} · {{ .WordCount }} words - {{ with .Params.tags }} + {{ range $term := .Params.tags }} + {{ with $.Site.GetPage (printf "/%s/%s" "tags" $term | urlize) }} <div class="tag-container"> - {{ range . }} <span class="tag"> - <a href="{{ "tags/" | absURL }}{{ . | urlize }}"> - {{.}} + <a href="{{ .RelPermalink }}"> + {{ $term }} </a> </span> - {{ end }} </div> {{ end }} + {{ end }} <hr/> {{ .Content }} </div> |