blog-theme/layouts/index.html
2023-03-01 19:54:26 -08:00

26 lines
832 B
HTML

{{ define "main" }}
{{ $pagination := .Paginate (where .Site.RegularPages "Params.hidden" "!=" true) }}
{{ partial "pagination.html" $pagination }}
{{ if eq $pagination.PageNumber 1 }}
{{ partial "content.html" .Content }}
{{ end }}
{{ $scratch := newScratch }}
{{ $scratch.Add "i" 0 }}
{{ range $pagination.Pages }}
{{ if or ($scratch.Get "i" | ne 0) (eq $pagination.PageNumber 1) }}
<br>
<hr>
<br>
{{ end }}
{{ $scratch.Set "i" ($scratch.Get "i" | add 1) }}
<article>
<header>
<h2><a href="{{ .RelPermalink }}">{{ partial "content.html" .Title }}</a></h2>
{{ partial "metadata.html" . }}
</header>
<br>
{{ partial "content.html" .Content | truncate 500 }} <a href="{{ .RelPermalink }}">Read more &raquo;</a>
</article>
{{ end }}
{{ partial "pagination.html" $pagination }}
{{ end }}