
Sections other than posts were displaying posts because it was hard coded in $contentTypeName.
37 lines
1.5 KiB
HTML
37 lines
1.5 KiB
HTML
{{ define "main" }}
|
|
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
|
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) .Section }}
|
|
{{ $paginator := .Paginate (where .Site.RegularPages "Type" $contentTypeName) }}
|
|
|
|
<main class="posts">
|
|
<h1>{{ .Title }}</h1>
|
|
|
|
{{ if .Content }}
|
|
<div class="content">{{ .Content }}</div>
|
|
{{ end }}
|
|
|
|
{{ range $paginator.Pages.GroupByDate "2006" }}
|
|
<div class="posts-group">
|
|
<div class="post-year">{{ .Key }}</div>
|
|
|
|
<ul class="posts-list">
|
|
{{ range .Pages }}
|
|
<li class="post-item">
|
|
<a href="{{.Permalink}}">
|
|
<span class="post-title">{{.Title}}</span>
|
|
<span class="post-day">
|
|
{{ if .Site.Params.dateformShort }}
|
|
{{ .Date.Format .Site.Params.dateformShort }}
|
|
{{ else }}
|
|
{{ .Date.Format "Jan 2"}}
|
|
{{ end }}
|
|
</span>
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
{{ end }}
|
|
{{ partial "pagination.html" . }}
|
|
</main>
|
|
{{ end }}
|