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

github.com/mdashx/basicwebtheme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortom <tom@mdashx.com>2020-12-15 00:03:20 +0300
committertom <tom@mdashx.com>2020-12-15 00:03:20 +0300
commit968bec8406c3afb1982c848200d26b9a11add03a (patch)
tree818a96a394b743241cc310d12b296bb2d499eaed
parent9cfc2d1665ada75970501ac1fc742cfc2d3e6cc4 (diff)
Optional random order on list pages
-rw-r--r--layouts/_default/list.html14
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 }}