mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
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.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
6c5ef71368
commit
c950699907
@@ -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
|
||||
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user