Add contentTypeName to config
This commit is contained in:
parent
27a013b809
commit
b0dfb769d1
2 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
|||
{{ define "main" }}
|
||||
<div class="posts">
|
||||
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
|
||||
{{ $isntDefault := not (or (eq (trim .Site.Params.contentTypeName " ") "posts") (eq (trim .Site.Params.contentTypeName " ") "")) }}
|
||||
{{ $contentTypeName := cond $isntDefault (string .Site.Params.contentTypeName) "posts" }}
|
||||
{{ $paginator := .Paginate (where .Data.Pages "Type" $contentTypeName) }}
|
||||
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="post on-list">
|
||||
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue