mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Merge commit 'd276e901b36d2576ef8350ed96b17f66254eac1b'
This commit is contained in:
@@ -42,14 +42,14 @@ Here is the list of "Related" methods available on a page collection such `.Regu
|
||||
Returns a collection of pages related the given one.
|
||||
|
||||
```
|
||||
{{ $related := .Site.RegularPages.Related . }}
|
||||
{{ $related := site.RegularPages.Related . }}
|
||||
```
|
||||
|
||||
#### .RelatedIndices PAGE INDICE1 [INDICE2 ...]
|
||||
Returns a collection of pages related to a given one restricted to a list of indices.
|
||||
|
||||
```
|
||||
{{ $related := .Site.RegularPages.RelatedIndices . "tags" "date" }}
|
||||
{{ $related := site.RegularPages.RelatedIndices . "tags" "date" }}
|
||||
```
|
||||
|
||||
#### .RelatedTo KEYVALS [KEYVALS2 ...]
|
||||
@@ -58,7 +58,7 @@ Returns a collection of pages related together by a set of indices and their mat
|
||||
In order to build those set and pass them as argument, one must use the `keyVals` function where the first argument would be the `indice` and the consecutive ones its potential `matches`.
|
||||
|
||||
```
|
||||
{{ $related := .Site.RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }}
|
||||
{{ $related := site.RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }}
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
|
Reference in New Issue
Block a user