Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-06-19 10:37:37 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-06-19 12:58:58 +0300
commit82abca32fa8791e526edd820c32c0b8f9d8e0e78 (patch)
tree6dca74b256e12d11fc0e64a9864e4c1860b0aac4 /docs/content/en/templates
parentfc045e12a953aac88b942c25b958c5c0554b252b (diff)
Add GroupByLastmod
Fixes #7408
Diffstat (limited to 'docs/content/en/templates')
-rw-r--r--docs/content/en/templates/lists.md37
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" >}}