diff options
author | tom <tom@mdashx.com> | 2020-12-15 00:03:20 +0300 |
---|---|---|
committer | tom <tom@mdashx.com> | 2020-12-15 00:03:20 +0300 |
commit | 968bec8406c3afb1982c848200d26b9a11add03a (patch) | |
tree | 818a96a394b743241cc310d12b296bb2d499eaed | |
parent | 9cfc2d1665ada75970501ac1fc742cfc2d3e6cc4 (diff) |
Optional random order on list pages
-rw-r--r-- | layouts/_default/list.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9449215..fc6218d 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -5,6 +5,18 @@ {{ $bigtitle := .Param "bigtitle" }} {{ $showdate := .Param "showdate" }} {{ $full := .Param "previewfullcontent" }} +{{ $randomorder := .Param "randomorder" }} + + +{{ if $randomorder }} + +{{ range shuffle .Pages }} + +{{ partial "post-preview.html" (dict "page" . "full" $full "bigtitle" $bigtitle "showdate" $showdate) }} + +{{ end }} + +{{ else }} {{ range .Pages }} @@ -13,3 +25,5 @@ {{ end }} {{ end }} + +{{ end }} |