diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-06-19 09:37:37 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-06-19 11:58:58 +0200 |
commit | 82abca32fa8791e526edd820c32c0b8f9d8e0e78 (patch) | |
tree | 6dca74b256e12d11fc0e64a9864e4c1860b0aac4 /docs | |
parent | fc045e12a953aac88b942c25b958c5c0554b252b (diff) |
Add GroupByLastmod
Fixes #7408
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/en/templates/lists.md | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/docs/content/en/templates/lists.md b/docs/content/en/templates/lists.md index c2140b472..be9df664c 100644 --- a/docs/content/en/templates/lists.md +++ b/docs/content/en/templates/lists.md @@ -424,7 +424,7 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h ### By Publish Date {{< code file="layouts/partials/by-page-publish-date.html" >}} -<!-- Groups content by month according to the "publishdate" field in front matter --> +<!-- Groups content by month according to the "publishDate" field in front matter --> {{ range .Pages.GroupByPublishDate "2006-01" }} <h3>{{ .Key }}</h3> <ul> @@ -438,6 +438,41 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h {{ end }} {{< /code >}} + +### By Lastmod + +{{< code file="layouts/partials/by-page-lastmod.html" >}} +<!-- Groups content by month according to the "lastMod" field in front matter --> +{{ range .Pages.GroupByLastmod "2006-01" }} +<h3>{{ .Key }}</h3> +<ul> + {{ range .Pages }} + <li> + <a href="{{ .Permalink }}">{{ .Title }}</a> + <div class="meta">{{ .Lastmod.Format "Mon, Jan 2, 2006" }}</div> + </li> + {{ end }} +</ul> +{{ end }} +{{< /code >}} + +### By Expiry Date + +{{< code file="layouts/partials/by-page-expiry-date.html" >}} +<!-- Groups content by month according to the "expiryDate" field in front matter --> +{{ range .Pages.GroupByExpiryDate "2006-01" }} +<h3>{{ .Key }}</h3> +<ul> + {{ range .Pages }} + <li> + <a href="{{ .Permalink }}">{{ .Title }}</a> + <div class="meta">{{ .ExpiryDate.Format "Mon, Jan 2, 2006" }}</div> + </li> + {{ end }} +</ul> +{{ end }} +{{< /code >}} + ### By Page Parameter {{< code file="layouts/partials/by-page-param.html" >}} |