Add Page.GetTerms

Fixes #6905
This commit is contained in:
Bjørn Erik Pedersen
2020-02-19 09:16:27 +01:00
parent 82029c1ec9
commit fa520a2d98
8 changed files with 82 additions and 15 deletions

View File

@@ -378,14 +378,10 @@ contentDir="content/sv"
{"List terms", func(b testing.TB) *sitesBuilder {
pageTemplateTemplate := `
{{ $taxo := "categories" }}
<ul>
{{ range .Param $taxo }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }}
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
{{ end }}
{{ end }}
{{ range (.GetTerms "categories") }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
`