diff options
author | Anton Staaf <github@socialhacker.com> | 2017-03-05 12:24:14 -0800 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-05 21:24:14 +0100 |
commit | c95069990795965c34059b6844fe9fa5125be7c1 (patch) | |
tree | 026805cb68b325d3bf045dc86596aba8f415f2dd /docs | |
parent | 6c5ef71368edfae8ffc77224ff6a9ec240c39626 (diff) |
hugolib: Populate the taxonomy term Pages list
Previously this was left empty, but it is very handy to have a list
of term pages for a given taxonomy. This list can now be paginated
like other page lists. It makes it possible to render summary
content from each terms index page for instance. It also makes it
possible to sort the term pages in the same way that other page
lists can be sorted. An RSS feed is now generated for
KindTaxonomyTerm pages as well.
This also fixes a bug in HugoSites.createMissingPages. Previously
it would only check for existing KindTaxonomyTerm pages if the
taxonomy had any terms defined. So for a taxonomy with no terms
but a taxonomy terms page it would generate a second empty terms
page.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/templates/rss.md | 8 | ||||
-rw-r--r-- | docs/content/templates/terms.md | 14 |
2 files changed, 21 insertions, 1 deletions
diff --git a/docs/content/templates/rss.md b/docs/content/templates/rss.md index d390b4306..fe445469a 100644 --- a/docs/content/templates/rss.md +++ b/docs/content/templates/rss.md @@ -48,6 +48,14 @@ Hugo will use the following prioritized list. If a file isn’t present, then th * /themes/`THEME`/layouts/\_default/rss.xml * [Embedded rss.xml](#the-embedded-rss-xml:eceb479b7b3b2077408a2878a29e1320) +### Taxonomy Terms RSS + +* /layouts/taxonomy/`SINGULAR`.terms.rss.xml +* /layouts/\_default/rss.xml +* /themes/`THEME`/layouts/taxonomy/`SINGULAR`.terms.rss.xml +* /themes/`THEME`/layouts/\_default/rss.xml +* [Embedded rss.xml](#the-embedded-rss-xml:eceb479b7b3b2077408a2878a29e1320) + ## Configuring RSS diff --git a/docs/content/templates/terms.md b/docs/content/templates/terms.md index 378bd4df8..f81fc8f71 100644 --- a/docs/content/templates/terms.md +++ b/docs/content/templates/terms.md @@ -57,6 +57,7 @@ Taxonomy Terms pages will additionally have: * **.Data.Singular** The singular name of the taxonomy * **.Data.Plural** The plural name of the taxonomy +* **.Data.Pages** (or as **.Pages**) The taxonomy Terms index pages * **.Data.Terms** The taxonomy itself * **.Data.Terms.Alphabetical** The Terms alphabetized * **.Data.Terms.ByCount** The Terms ordered by popularity @@ -121,7 +122,7 @@ Another example listing the content for each term (ordered by Date): ## Ordering -Hugo can order the meta data in two different ways. It can be ordered: +Hugo can order the term meta data in two different ways. It can be ordered: * by the number of contents assigned to that key, or * alphabetically. @@ -162,3 +163,14 @@ Hugo can order the meta data in two different ways. It can be ordered: </section> {{ partial "footer.html" . }} + +Hugo can also order and paginate the term index pages in all the normal ways. + +### Example terms.html snippet (paginated and ordered by date) + + <h1 id="title">{{ .Title }}</h1> + <ul> + {{ range .Paginator.Pages.ByDate.Reverse }} + <li><a href="{{ .Permalink }}">{{ .Title }}</a> {{ $.Data.Terms.Count .Data.Term }}</li> + {{ end }} + </ul> |