hugo-theme-flat/layouts/index.html
2022-09-04 19:11:04 +08:00

43 lines
1.5 KiB
HTML

{{ define "main" }}
<div class="max-wrapper">
<div id="list-page">
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $paginator := .Paginate $pages }}
{{ range $paginator.Pages }}
<section class="list-item">
<h1 class="title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
<div class="tips">
<div class="date">
<time datetime="{{ .PublishDate }}">{{ .PublishDate.Format "2006/01/02" }}</time>
</div>
{{ with .Params.Categories }}
<div class="categories">
<span>Categories:</span>
{{ range first 2 . }}
<a href="{{ "categories/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end }}
{{ with .Params.Tags }}
<div class="tags">
<span>Tags:</span>
{{ range first 5 . }}
<a href="{{ "tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end }}
</div>
<div class="summary">{{ .Summary }}</div>
</section>
{{ end }}
</div>
{{ partial "pagination.html" . }}
</div>
{{ end }}