mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
@@ -11,9 +11,9 @@ action:
|
||||
toc: true
|
||||
---
|
||||
|
||||
The `Alphabetical` method on a `Taxonomy` object returns an [ordered taxonomy], sorted alphabetically by [term].
|
||||
The `Alphabetical` method on a `Taxonomy` object returns an [ordered taxonomy](g), sorted alphabetically by [term](g).
|
||||
|
||||
While a `Taxonomy` object is a [map], an ordered taxonomy is a [slice], where each element is an object that contains the term and a slice of its [weighted pages].
|
||||
While a `Taxonomy` object is a [map](g), an ordered taxonomy is a [slice](g), where each element is an object that contains the term and a slice of its [weighted pages](g).
|
||||
|
||||
{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
|
||||
|
||||
@@ -69,10 +69,3 @@ Hugo renders:
|
||||
<li><a href="/books/jamaica-inn/">Jamaica inn</a></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
[ordered taxonomy]: /getting-started/glossary/#ordered-taxonomy
|
||||
[term]: /getting-started/glossary/#term
|
||||
[map]: /getting-started/glossary/#map
|
||||
[slice]: /getting-started/glossary/#slice
|
||||
[term]: /getting-started/glossary/#term
|
||||
[weighted pages]: /getting-started/glossary/#weighted-page
|
||||
|
@@ -11,9 +11,9 @@ action:
|
||||
toc: true
|
||||
---
|
||||
|
||||
The `ByCount` method on a `Taxonomy` object returns an [ordered taxonomy], sorted by the number of pages associated with each [term].
|
||||
The `ByCount` method on a `Taxonomy` object returns an [ordered taxonomy](g), sorted by the number of pages associated with each [term](g).
|
||||
|
||||
While a `Taxonomy` object is a [map], an ordered taxonomy is a [slice], where each element is an object that contains the term and a slice of its [weighted pages].
|
||||
While a `Taxonomy` object is a [map](g), an ordered taxonomy is a [slice](g), where each element is an object that contains the term and a slice of its [weighted pages](g).
|
||||
|
||||
{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
|
||||
|
||||
@@ -69,10 +69,3 @@ Hugo renders:
|
||||
<li><a href="/books/pride-and-prejudice/">Pride and prejudice</a></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
[ordered taxonomy]: /getting-started/glossary/#ordered-taxonomy
|
||||
[term]: /getting-started/glossary/#term
|
||||
[map]: /getting-started/glossary/#map
|
||||
[slice]: /getting-started/glossary/#slice
|
||||
[term]: /getting-started/glossary/#term
|
||||
[weighted pages]: /getting-started/glossary/#weighted-page
|
||||
|
@@ -10,7 +10,7 @@ action:
|
||||
toc: true
|
||||
---
|
||||
|
||||
The `Count` method on a `Taxonomy` object returns the number of number of [weighted pages] to which the given [term] has been assigned.
|
||||
The `Count` method on a `Taxonomy` object returns the number of number of [weighted pages](g) to which the given [term](g) has been assigned.
|
||||
|
||||
{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
|
||||
|
||||
@@ -21,6 +21,3 @@ Now that we have captured the "genres" `Taxonomy` object, let's count the number
|
||||
```go-html-template
|
||||
{{ $taxonomyObject.Count "suspense" }} → 3
|
||||
```
|
||||
|
||||
[weighted pages]: /getting-started/glossary/#weighted-page
|
||||
[term]: /getting-started/glossary/#term
|
||||
|
@@ -10,7 +10,7 @@ action:
|
||||
toc: true
|
||||
---
|
||||
|
||||
The `Get` method on a `Taxonomy` object returns a slice of [weighted pages] to which the given [term] has been assigned.
|
||||
The `Get` method on a `Taxonomy` object returns a slice of [weighted pages](g) to which the given [term](g) has been assigned.
|
||||
|
||||
{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
|
||||
|
||||
@@ -28,7 +28,7 @@ The above is equivalent to:
|
||||
{{ $weightedPages := $taxonomyObject.suspense }}
|
||||
```
|
||||
|
||||
But, if the term is not a valid [identifier], you cannot use the [chaining] syntax. For example, this will throw an error because the identifier contains a hyphen:
|
||||
But, if the term is not a valid [identifier](g), you cannot use the [chaining](g) syntax. For example, this will throw an error because the identifier contains a hyphen:
|
||||
|
||||
```go-html-template
|
||||
{{ $weightedPages := $taxonomyObject.my-genre }}
|
||||
@@ -65,8 +65,4 @@ Hugo renders:
|
||||
<h2><a href="/books/and-then-there-were-none/">And then there were none</a></h2>
|
||||
```
|
||||
|
||||
[chaining]: /getting-started/glossary/#chain
|
||||
[`index`]: /functions/collections/indexfunction/
|
||||
[identifier]: /getting-started/glossary/#identifier
|
||||
[term]: /getting-started/glossary/#term
|
||||
[weighted pages]: /getting-started/glossary/#weighted-page
|
||||
|
@@ -59,7 +59,6 @@ Although the [`Alphabetical`] and [`ByCount`] methods provide a better data stru
|
||||
|
||||
In the example above, the first anchor element is a link to the term page.
|
||||
|
||||
|
||||
[`Alphabetical`]: /methods/taxonomy/alphabetical/
|
||||
[`ByCount`]: /methods/taxonomy/bycount/
|
||||
|
||||
|
@@ -13,13 +13,12 @@ Page
|
||||
: (`page.Page`) Returns the term's `Page` object, useful for linking to the term page.
|
||||
|
||||
Pages
|
||||
: (`page.Pages`) Returns a `Pages` object containing the `Page` objects to which the term is assigned, sorted by [taxonomic weight]. To sort or group, use any of the [methods] available to the `Pages` object. For example, sort by the last modification date.
|
||||
: (`page.Pages`) Returns a `Pages` object containing the `Page` objects to which the term is assigned, sorted by [taxonomic weight](g). To sort or group, use any of the [methods] available to the `Pages` object. For example, sort by the last modification date.
|
||||
|
||||
Term
|
||||
: (`string`) Returns the term name.
|
||||
|
||||
WeightedPages
|
||||
: (`page.WeightedPages`) Returns a slice of weighted pages to which the term is assigned, sorted by [taxonomic weight]. The `Pages` method above is more flexible, allowing you to sort and group.
|
||||
: (`page.WeightedPages`) Returns a slice of weighted pages to which the term is assigned, sorted by taxonomic weight. The `Pages` method above is more flexible, allowing you to sort and group.
|
||||
|
||||
[methods]: /methods/pages/
|
||||
[taxonomic weight]: /getting-started/glossary/#taxonomic-weight
|
||||
|
Reference in New Issue
Block a user