From 45a35dc7928ef3c453be0d05aa032e03770bf2f1 Mon Sep 17 00:00:00 2001 From: paspo Date: Thu, 31 Oct 2024 21:54:39 +0100 Subject: [PATCH 1/3] 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 }} -- 2.47.2 From 500522c3147a0f75fb35e11ee7ddf1cdca509715 Mon Sep 17 00:00:00 2001 From: paspo Date: Thu, 31 Oct 2024 22:00:50 +0100 Subject: [PATCH 2/3] disabilitazione homepage per post specifici --- layouts/partials/homepage/blocks/posts_homepage.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/homepage/blocks/posts_homepage.html b/layouts/partials/homepage/blocks/posts_homepage.html index 9e54e02..51d7e46 100644 --- a/layouts/partials/homepage/blocks/posts_homepage.html +++ b/layouts/partials/homepage/blocks/posts_homepage.html @@ -1,4 +1,6 @@ {{- $pages := (where .ctx.Site.RegularPages "Section" "in" .item.sections ) }} +{{- $pages := (where $pages ".Params.homepage" "ne" false ) }} + {{- if gt (len $pages) 0 }}
-- 2.47.2 From 57c1d5582aa3396dc1b01cfe06bbf7ca4acb5779 Mon Sep 17 00:00:00 2001 From: paspo Date: Thu, 31 Oct 2024 22:04:31 +0100 Subject: [PATCH 3/3] configurazione homepage --- data/en/homepage.yml | 6 +++++- data/it/homepage.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/en/homepage.yml b/data/en/homepage.yml index d865994..b13eac3 100644 --- a/data/en/homepage.yml +++ b/data/en/homepage.yml @@ -14,9 +14,13 @@ items: title: More information contents: "The entrance has been moved to Via San Giovanni Bosco 16" - heading: Latest posts and events - type: posts_homepage_grouping + type: posts_homepage max: 6 featured_first: true + sections: + - events + - linuxday + - posts - type: highlights items_per_row: 2 items: diff --git a/data/it/homepage.yml b/data/it/homepage.yml index 8861ffe..920b66b 100644 --- a/data/it/homepage.yml +++ b/data/it/homepage.yml @@ -14,9 +14,13 @@ items: title: Più informazioni contents: "L'entrata è stata spostata in Via San Giovanni Bosco 16" - heading: Ultimi post ed eventi - type: posts_homepage_grouping + type: posts_homepage max: 6 featured_first: true + sections: + - events + - linuxday + - posts - type: highlights items_per_row: 2 items: -- 2.47.2