vugo/layouts/_default/index.html
2022-08-18 14:52:42 +02:00

54 lines
1.5 KiB
HTML

{{ define "main" }}
{{ .Content -}}
<div class="posts">
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "rambles") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "rambles" }}
{{ $PageContext := . }}
{{ if .IsHome }}
{{ $PageContext = .Site }}
{{ end }}
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
<article class="post on-list">
<div class="post-meta">
{{ if .Params.Date }}
<span>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<span> - </span>
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
{{ if $.Site.Params.showLastUpdated }}
{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
{{ end }}
</span>
{{ end }}
{{ with .Params.Author }}
<span> - </span>
<span class="post-author">{{ . }}</span>
{{ end }}
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
<span class="post-reading-time">- {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
{{ end }}
</span>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</div>
</article>
{{ end }}
{{ partial "pagination.html" . }}
{{ partial "stickers.html" . }}
</div>
{{ end }}