bglug.it/layouts/partials/homepage/blocks/posts_homepage_grouping.html
paspo 40d9b9fb49
Some checks failed
Container Publish / build-image (push) Successful in 6m53s
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 1m52s
External links check / Check all external links (push) Failing after 3m6s
homepage grouping (#308)
fixes #291

Reviewed-on: #308
Reviewed-by: omar <omarl@noreply.libreschool.org>
Co-authored-by: paspo <paolo@asperti.com>
Co-committed-by: paspo <paolo@asperti.com>
2024-10-28 07:05:54 +00:00

29 lines
936 B
HTML

{{- $pages := (where .ctx.Site.RegularPages ".Params.grouping" "intersect" (slice "homepage")) }}
{{- if gt (len $pages) 0 }}
<section class="wrapper style1">
<div class="container">
{{ with .item.heading }}<h2>{{ . }}</h2>{{ end }}
{{ if eq .item.featured_first true }}
<div class="row">
{{- range $idx, $itm := first 1 $pages }}
{{- .Render "shortblock_wide" -}}
{{- end }}
</div>
{{- $pages = after 1 $pages }}
{{- end }}
{{- 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 }}