--- title: GroupByPublishDate description: Returns the given page collection grouped by publish date in descending order. categories: [] keywords: [] params: functions_and_methods: returnType: page.PagesGroup signatures: ['PAGES.GroupByPublishDate LAYOUT [SORT]'] --- When grouping by publish date, the value is determined by your [site configuration], defaulting to the `publishDate` field in front matter. The [layout string] has the same format as the layout string for the [`time.Format`] function. The resulting group key is [localized](g) for language and region. [`time.Format`]: /functions/time/format/ [layout string]: #layout-string [site configuration]: /configuration/front-matter/#dates {{% include "/_common/methods/pages/group-sort-order.md" %}} To group content by year and month: ```go-html-template {{ range .Pages.GroupByPublishDate "January 2006" }}
{{ .Key }}
{{ .Key }}
{{ .Key }}