diff --git a/README.md b/README.md index b8c3716..a473751 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ paginate = 5 [params] subtitle = "A simple theme for Hugo" + # dir name for your list content + contentTypeName = "posts" # "light" or "dark" defaultTheme = "dark" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4ceeb47..74e2885 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,9 @@ {{ define "main" }}
- {{ $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 }}

{{ .Title | markdownify }}