docs: Example of how to use Order by ExpiryDate
authorHanchen Wang <hanchen.wang@mail.utoronto.ca>
Wed, 11 May 2016 14:16:44 +0000 (10:16 -0400)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 14 Jun 2016 13:45:26 +0000 (15:45 +0200)
docs/content/templates/list.md

index 3ce293dac42985fa6db028d014deefd3b8b75257..39a4b10ea51156b4a11c85cf9e170d16d175442e 100644 (file)
@@ -187,6 +187,15 @@ your list templates:
     <div class="meta">{{ .PublishDate.Format "Mon, Jan 2, 2006" }}</div>
     </li>
     {{ end }}
+
+### Order by ExpiryDate
+
+    {{ range .Data.Pages.ByExpiryDate }}
+    <li>
+    <a href="{{ .Permalink }}">{{ .Title }}</a>
+    <div class="meta">{{ .ExpiryDate.Format "Mon, Jan 2, 2006" }}</div>
+    </li>
+    {{ end }}
     
 ### Order by Lastmod