homepage grouping #308
@ -12,15 +12,10 @@ items:
|
|||||||
link:
|
link:
|
||||||
url: /it/posts/2024/09/2024-09-28-cambio-entrata/
|
url: /it/posts/2024/09/2024-09-28-cambio-entrata/
|
||||||
title: Più informazioni
|
title: Più informazioni
|
||||||
|
max: 6
|
||||||
|
type: posts_homepage_grouping
|
||||||
|
- heading: Ultimi post ed eventi
|
||||||
contents: "L'entrata è stata spostata in Via San Giovanni Bosco 16"
|
contents: "L'entrata è stata spostata in Via San Giovanni Bosco 16"
|
||||||
- heading: Ultimi post
|
|
||||||
type: posts
|
|
||||||
content_type: posts
|
|
||||||
max: 4
|
|
||||||
- heading: Ultimi Eventi
|
|
||||||
type: posts
|
|
||||||
content_type: events
|
|
||||||
max: 4
|
|
||||||
- type: highlights
|
- type: highlights
|
||||||
items_per_row: 2
|
items_per_row: 2
|
||||||
items:
|
items:
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
{{- $pages := (where .ctx.Site.Pages ".Params.grouping" "intersect" (slice "homepage")) }}
|
||||||
|
|||||||
|
{{- if gt (len $pages) 0 }}
|
||||||
|
<section class="wrapper style1">
|
||||||
|
<div class="container">
|
||||||
|
{{ with .item.heading }}<h2>{{ . }}</h2>{{ end }}
|
||||||
amreo
commented
Perché in alcuni casi scrivi Perché in alcuni casi scrivi `{{- if` e altri `{{ if`? Chiedo, pur non sapendo esattamente il linguaggio di templating di hugo.
paspo
commented
serve a rimuovere gli spazi prima ( serve a rimuovere gli spazi prima (`{{-`) o dopo (`-]}`) il codice
|
|||||||
|
{{- range $idx, $itm := first (.item.max | default 4) $pages }}
|
||||||
|
{{- $rowpos := mod $idx 2 }}
|
||||||
|
{{- if eq $rowpos 0 }}
|
||||||
|
<div class="row">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{- .Render "shortblock" -}}
|
||||||
|
|
||||||
|
{{ if or (eq $rowpos 1) (eq $idx (len $pages)) -}}
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
Loading…
x
Reference in New Issue
Block a user
.Site.Regularpages
forza l'ordinamento di default di Hugo.Vedi qui