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

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Rawlins <luke.rawlins@outlook.com>2020-10-04 01:43:48 +0300
committerLuke Rawlins <luke.rawlins@outlook.com>2020-10-04 01:43:48 +0300
commita90171fdb15bfaae3d2cdf1ead707e57219ec116 (patch)
tree037e98087238370da6fd94dad052c696a3622261 /layouts
parent5952da59b170ee50fce57f9a5ebb938b213297c2 (diff)
Individual taxonomies now display properly as links and the urls are routed correctly to the proper taxonomy term.
Fixes #236
Diffstat (limited to 'layouts')
-rw-r--r--layouts/blog/single.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/layouts/blog/single.html b/layouts/blog/single.html
index 3aecef2..877be4b 100644
--- a/layouts/blog/single.html
+++ b/layouts/blog/single.html
@@ -43,11 +43,13 @@
</div>
{{ end }}
{{ range $taxonomy_term, $taxonomy := .Params }}
- {{ with $.Site.GetPage (printf "/%s" $taxonomy_term) }}
- <p>
+ {{ with $.Site.GetPage $taxonomy_term }}
+ {{ $len := (len $taxonomy) }}
+ <p>
{{ $taxonomy_term | title }}:
- <a href="{{ .Permalink }}">{{ range $key, $value := $taxonomy }}
- {{ $value }}</a>
+ {{ range $key, $value := $taxonomy }}
+ <a href="{{ (printf "/%s/" $taxonomy_term) | relLangURL }}{{ . | urlize }}">
+ {{ $value }}</a>{{ if ne (add $key 1) $len }},{{ end }}
{{ end }}
</p>
{{ end }}