diff --git a/content/templates/list.md b/content/templates/list.md index c4c0bc29b..d2b58c49c 100644 --- a/content/templates/list.md +++ b/content/templates/list.md @@ -178,6 +178,15 @@ your list templates: {{ end }} +### Order by PublishDate + + {{ range .Data.Pages.ByPublishDate }} +
  • + {{ .Title }} +
    {{ .PublishDate.Format "Mon, Jan 2, 2006" }}
    +
  • + {{ end }} + ### Order by Length {{ range .Data.Pages.ByLength }} @@ -219,7 +228,7 @@ Can be applied to any of the above. Using Date for an example. ## Grouping Content Hugo provides some grouping functions for list pages. You can use them to -group pages by Section, Date etc. +group pages by Section, Type, Date etc. Here are a variety of different ways you can group the content items in your list templates: @@ -252,6 +261,48 @@ your list templates: {{ end }} +### Grouping by Page publish date + + {{ range .Data.Pages.GroupByPublishDate "2006-01" }} +

    {{ .Key }}

    + + {{ end }} + +### Grouping by Page param + + {{ range .Data.Pages.GroupByParam "param_key" }} +

    {{ .Key }}

    + + {{ end }} + +### Grouping by Page param in date format + + {{ range .Data.Pages.GroupByParamDate "param_key" "2006-01" }} +

    {{ .Key }}

    + + {{ end }} + ### Reversing Key Order The ordering of the groups is performed by keys in alpha-numeric order (A–Z,