blog/themes/chosto/layouts/_default/list.html

35 lines
1.1 KiB
HTML

{{ define "main" }}
<div class="section pt-5">
<div class="container is-max-widescreen">
<main>
{{ with .Content }}
<article class="message mt-5 mb-2">
<div class="message-body content">
{{ . }}
</div>
</article>
{{ end }}
<div class="columns is-multiline">
<!-- Custom paginator with only blog posts -->
<!-- Annoying hackish stuff to only select pages belonging to the current section -->
{{ $articlesInSection := slice }}
{{ range .Site.RegularPages }}
{{ if $.IsAncestor . }}
{{ $articlesInSection = $articlesInSection | append . }}
{{ end }}
{{ end }}
{{ $paginator := .Paginate $articlesInSection }}
{{ range $paginator.Pages }}
{{ if (eq .FirstSection.Section "posts")}}
<div class="column is-variable is-one-third">
{{ .Render "summary" }}
</div>
{{ end }}
{{ end }}
</div>
{{- partial "pagination.html" $paginator -}}
</main>
</div>
</div>
{{ end }}