diff options
author | Victoria Drake <hello@victoria.dev> | 2020-10-12 02:48:17 +0300 |
---|---|---|
committer | Victoria Drake <hello@victoria.dev> | 2020-10-12 02:48:17 +0300 |
commit | d81ebc6c8efb8f4a411aa1b24d2a35bd5911d02c (patch) | |
tree | 614e8c8e03377e250210a64083f6fe15bc728fc0 | |
parent | 193dc1a0d39afe05710ae5843ef70e5a131407b2 (diff) | |
parent | fae154e857436475fe83cb39efe1d0d62e81582c (diff) |
Merge branch 'thegreatluke-fix-236'
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | exampleSite/content/en/blog/configuration.md | 1 | ||||
-rw-r--r-- | layouts/blog/single.html | 21 |
3 files changed, 14 insertions, 9 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index e5e2d74..f2dfc27 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -74,6 +74,7 @@ DefaultContentLanguage = "en" # Default language fo # You can add more by yourself [taxonomies] tag = "tags" + series = "series" [markup] defaultMarkdownHandler = "goldmark" diff --git a/exampleSite/content/en/blog/configuration.md b/exampleSite/content/en/blog/configuration.md index dc76d37..148823e 100644 --- a/exampleSite/content/en/blog/configuration.md +++ b/exampleSite/content/en/blog/configuration.md @@ -2,6 +2,7 @@ title: "Theme Features" date: 2020-07-25T02:04:06-05:00 tags: ["code"] +series: ["quickstart"] --- Here are some helpful tips for setting up this theme. diff --git a/layouts/blog/single.html b/layouts/blog/single.html index f5fadb7..877be4b 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -42,14 +42,17 @@ {{ end }} </div> {{ end }} - {{ if .Params.tags }} - {{ $len := (len .Params.tags) }} - <p> - Tag{{ if gt $len 1 }}s{{ end }}: - {{ range $index, $tag := .Params.tags }} - <a href="{{ "tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>{{ if ne (add $index 1) $len }},{{ end }} - {{ end }} - </p> + {{ range $taxonomy_term, $taxonomy := .Params }} + {{ with $.Site.GetPage $taxonomy_term }} + {{ $len := (len $taxonomy) }} + <p> + {{ $taxonomy_term | title }}: + {{ range $key, $value := $taxonomy }} + <a href="{{ (printf "/%s/" $taxonomy_term) | relLangURL }}{{ . | urlize }}"> + {{ $value }}</a>{{ if ne (add $key 1) $len }},{{ end }} + {{ end }} + </p> + {{ end }} {{ end }} </div> <!-- Begin blog post content --> @@ -58,4 +61,4 @@ </div> <!-- End blog post content --> {{ partial "comments.html" . }} -{{ end }}
\ No newline at end of file +{{ end }} |