lumbung.space/themes/lumbung-theme/layouts/_default/list.html
2022-10-10 09:35:35 +02:00

48 lines
1.7 KiB
HTML

{{ define "main" }}
<main>
<section class='entries'>
<div class="h-feed">
{{ $range := where .Pages "Params.hidden" "ne" "true" }}
{{ $paginator := .Paginate $range }}
{{ $pageSize := $paginator.PageSize }}
{{ $totalPostsToShow := mul $paginator.PageNumber $pageSize }}
{{ range $index, $el := (first $totalPostsToShow $range) }}
<div class='post {{if eq .Section "tv"}}tv{{ end }}' {{ if eq $index (sub $totalPostsToShow $pageSize) }}id="newpage"{{ end }}>
{{if eq .Section "tv"}}
{{- partial "video_box.html" . -}}
{{ else if eq .Section "events" }}
{{- partial "partials/calendar_card.html" . -}}
{{ else if eq .Section "shouts" }}
{{ if in .Params.sources "pen.lumbung.space" }}
{{- partial "partials/pen_card.html" . -}}
{{ else }}
{{- partial "partials/shout_card.html" . -}}
{{ end }}
{{ else if eq .Section "social" }}
{{- partial "partials/social_card.html" . -}}
{{ else if eq .Section "publications"}}
{{- partial "partials/book_card.html" . -}}
{{ else if eq .Section "sounds"}}
{{- partial "sounds_card.html" . -}}
{{ else }}
{{- partial "card.html" . -}}
{{ end }}
</div>
{{ end }}
</div>
<div class="page-nav">
{{ if and (gt $paginator.TotalPages 1) ($paginator.HasNext) }}
<a id="load-more-paginator" class="nextpage" href="{{ $paginator.Next.URL }}#newpage">load more</a>
{{ end }}
</div>
</section>
</main>
{{ end }}