Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hivickylai/hugo-theme-sam.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbriggySmalls <briggySmalls90@gmail.com>2020-02-10 02:24:05 +0300
committerbriggySmalls <briggySmalls90@gmail.com>2020-02-10 02:24:05 +0300
commitad2f85017f1a28a725e132ecf86181fbce0337de (patch)
treebc64625daa7cbcfede7ca71fce696cc00b4ca1a9 /layouts
parentf44f118c48a5b66797d43c36757944cb7b51901d (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-xlayouts/posts/single.html10
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") }} &#183; {{ .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>