Fix section list pages

Sections other than posts were displaying posts because it was hard coded in $contentTypeName.
This commit is contained in:
Robleh Esa 2020-05-12 16:55:43 -04:00 committed by GitHub
parent 23434e2102
commit 4d65cf7d78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
{{ define "main" }}
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) .Section }}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" $contentTypeName) }}
<main class="posts">