From 45a35dc7928ef3c453be0d05aa032e03770bf2f1 Mon Sep 17 00:00:00 2001 From: paspo Date: Thu, 31 Oct 2024 21:54:39 +0100 Subject: [PATCH] visualizza solo posts di alcune categorie in homepage --- .../homepage/blocks/posts_homepage.html | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 layouts/partials/homepage/blocks/posts_homepage.html diff --git a/layouts/partials/homepage/blocks/posts_homepage.html b/layouts/partials/homepage/blocks/posts_homepage.html new file mode 100644 index 0000000..9e54e02 --- /dev/null +++ b/layouts/partials/homepage/blocks/posts_homepage.html @@ -0,0 +1,28 @@ +{{- $pages := (where .ctx.Site.RegularPages "Section" "in" .item.sections ) }} +{{- if gt (len $pages) 0 }} +
+
+ {{ with .item.heading }}

{{ . }}

{{ end }} + {{ if eq .item.featured_first true }} +
+ {{- range $idx, $itm := first 1 $pages }} + {{- .Render "shortblock_wide" -}} + {{- end }} +
+ {{- $pages = after 1 $pages }} + {{- end }} + {{- range $idx, $itm := first (.item.max | default 4) $pages }} + {{- $rowpos := mod $idx 2 }} + {{- if eq $rowpos 0 }} +
+ {{ end }} + + {{- .Render "shortblock" -}} + + {{ if or (eq $rowpos 1) (eq $idx (len $pages)) -}} +
+ {{- end }} + {{- end }} +
+
+{{ end }}