mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae'
This commit is contained in:
@@ -35,7 +35,7 @@ The template above is rendered to:
|
||||
|
||||
## Example of `after` with `first`: 2nd–4th most recent articles
|
||||
|
||||
You can use `after` in combination with the [`first`] function and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page] to show only two rows:
|
||||
You can use `after` in combination with the [`first`] function and Hugo's [powerful sorting methods](/quick-reference/page-collections/#sort). Let's assume you have a `section` page at `example.com/articles`. You have 10 articles, but you want your template to show only two rows:
|
||||
|
||||
1. The top row is titled "Featured" and shows only the most recently published article (i.e. by `publishdate` in the content files' front matter).
|
||||
2. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.
|
||||
@@ -66,6 +66,4 @@ You can use `after` in combination with the [`first`] function and Hugo's [power
|
||||
{{< /code >}}
|
||||
|
||||
[`first`]: /functions/collections/first/
|
||||
[list/section page]: /templates/section-templates/
|
||||
[lists]: /templates/lists/#sort-content
|
||||
[`slice`]: /functions/collections/slice/
|
||||
|
@@ -28,4 +28,4 @@ aliases: [/functions/group]
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
The page group you get from `group` is of the same type you get from the built-in [group methods](/templates/lists#group-content) in Hugo. The above example can be [paginated](/templates/pagination/#list-paginator-pages).
|
||||
The page group you get from `group` is of the same type you get from the built-in [group methods](/quick-reference/page-collections/#group) in Hugo. The example above can be [paginated](/templates/pagination/).
|
||||
|
@@ -25,6 +25,3 @@ A useful example is to use it as `AND` filters when combined with where:
|
||||
The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page parameters.
|
||||
|
||||
See [union](/functions/collections/union) for `OR`.
|
||||
|
||||
[partials]: /templates/partials/
|
||||
[single]: /templates/single-page-templates/
|
||||
|
Reference in New Issue
Block a user