Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -1,56 +1,38 @@
---
title: Page collections
description: A quick reference guide to Hugo's page collections.
categories: [quick reference]
categories: []
keywords: []
menu:
docs:
parent: quick-reference
weight: 60
weight: 60
toc: true
---
## Page
assets/
Use these `Page` methods when rendering lists on [section pages](g), [taxonomy pages](g), [term pages](g), and the home page.
{{< list-pages-in-section path=/methods/page filter=methods_page_page_collections filterType=include omitElementIDs=true titlePrefix=PAGE. >}}
{{% list-pages-in-section path=/methods/page filter=methods_page_page_collections filterType=include titlePrefix=PAGE. %}}
## Site
Use these `Site` methods when rendering lists on any page.
{{< list-pages-in-section path=/methods/site filter=methods_site_page_collections filterType=include omitElementIDs=true titlePrefix=SITE. >}}
{{% list-pages-in-section path=/methods/site filter=methods_site_page_collections filterType=include titlePrefix=SITE. %}}
## Filter
Use the [`where`] function to filter page collections.
[`where`]: /functions/collections/where/
## Sort
By default, Hugo sorts page collections by:
{{% glossary-term "default sort order" %}}
1. [Weight]
1. [Date] in descending order
1. [LinkTitle] falling back to [Title]
1. [Filename] if the page is backed by a file
Use these methods to sort page collections by different criteria.
[Date]: /methods/page/date/
[Weight]: /methods/page/weight/
[LinkTitle]: /methods/page/linktitle/
[Title]: /methods/page/title/
[Filename]: /methods/page/file/#filename
Use these methods to sort page collections.
{{< list-pages-in-section path=/methods/pages filter=methods_pages_sort filterType=include titlePrefix=. omitElementIDs=true titlePrefix=PAGES. >}}
{{% list-pages-in-section path=/methods/pages filter=methods_pages_sort filterType=include titlePrefix=. titlePrefix=PAGES. %}}
## Group
Use these methods to group page collections.
{{< list-pages-in-section path=/methods/pages filter=methods_pages_group filterType=include titlePrefix=. omitElementIDs=true titlePrefix=PAGES. >}}
{{% list-pages-in-section path=/methods/pages filter=methods_pages_group filterType=include titlePrefix=. titlePrefix=PAGES. %}}
[`where`]: /functions/collections/where/