mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae'
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
Before we can use a `Taxonomy` method, we need to capture a `Taxonomy` object.
|
||||
|
||||
## Capture a taxonomy object
|
||||
## Capture a Taxonomy object
|
||||
|
||||
Consider this site configuration:
|
||||
|
||||
@@ -26,13 +26,13 @@ content/
|
||||
└── _index.md
|
||||
```
|
||||
|
||||
To capture the "genres" taxonomy object from within any template, use the [`Taxonomies`] method on a `Site` object.
|
||||
To capture the "genres" `Taxonomy` object from within any template, use the [`Taxonomies`] method on a `Site` object.
|
||||
|
||||
```go-html-template
|
||||
{{ $taxonomyObject := .Site.Taxonomies.genres }}
|
||||
```
|
||||
|
||||
To capture the "genres" taxonomy object when rendering its page with a taxonomy template, use the [`Terms`] method on the page's [`Data`] object:
|
||||
To capture the "genres" `Taxonomy` object when rendering its page with a taxonomy template, use the [`Terms`] method on the page's [`Data`] object:
|
||||
|
||||
{{< code file=layouts/_default/taxonomy.html >}}
|
||||
{{ $taxonomyObject := .Data.Terms }}
|
||||
|
Reference in New Issue
Block a user