ezhil/layouts/index.html
Timo Ollech 2dcf88303a
replace .RawContent with .Summary - looks way better
.Summary retains all formatting of posts for the paginator which looks much nicer than .RawContent. The length of the .Summary (in words, not characters) can be set via the config variable summaryLength.
2020-02-11 21:40:23 +01:00

35 lines
978 B
HTML

<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
<div class="container wrapper">
{{ partial "head.html" . }}
<div class="recent-posts section">
<h2 class="section-header">
Recent posts
</h2>
<div class="posts">
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
{{ range $paginator.Pages }}
<div class="post">
<div class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
<a class="title" href="{{ .RelPermalink }}">{{.Title}}</a> &mdash;
<span class="description">
{{ if isset .Params "description" }}
{{ .Description }}
{{ else }}
{{ .Summary }}&hellip;
{{ end }}
</span>
</div>
{{ end }}
{{ template "partials/paginator.html" . }}
</div>
</div>
</div>
{{ partial "footer.html" . }}
</body>
</html>