From 8dee2d1294b1f045621ebb93b1f9407d6fccd5ec Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 29 May 2022 10:36:53 +0200 Subject: Fix default section type for the `params.mainSections` --- CHANGELOG.md | 1 + layouts/_default/list.atom.xml | 2 +- layouts/_default/list.feed.xml | 2 +- layouts/_default/list.html.html | 12 ++++++------ layouts/_default/list.json.json | 2 +- layouts/index.html | 14 +++++++------- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2990ef..905aad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix margin bottom on the nested unordered lists for page's table of contents +- Fix default section type for the `params.mainSections` configuration variable ## v0.1.0 - 2022-05-27 diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index bd1f982..75892fd 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -3,7 +3,7 @@ {{- $pages := slice -}} {{- if $.IsHome -}} - {{- $mainSections := site.Params.mainSections | default (slice "post") }} + {{- $mainSections := site.Params.mainSections | default (slice "posts") }} {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}} {{- else if $.IsSection -}} {{- $pages = $pctx.RegularPages.ByDate.Reverse -}} diff --git a/layouts/_default/list.feed.xml b/layouts/_default/list.feed.xml index 87d62cc..ae16aca 100644 --- a/layouts/_default/list.feed.xml +++ b/layouts/_default/list.feed.xml @@ -3,7 +3,7 @@ {{- $pages := slice -}} {{- if $.IsHome -}} - {{- $mainSections := site.Params.mainSections | default (slice "post") }} + {{- $mainSections := site.Params.mainSections | default (slice "posts") }} {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}} {{- else if $.IsSection -}} {{- $pages = $pctx.RegularPages.ByDate.Reverse -}} diff --git a/layouts/_default/list.html.html b/layouts/_default/list.html.html index 13f2947..1badde4 100644 --- a/layouts/_default/list.html.html +++ b/layouts/_default/list.html.html @@ -1,13 +1,13 @@ {{ define "main" }}
{{ with .Title }}

{{ . }}

{{ end }} - {{- with .Content }} -
- {{ .Content }} -
- {{- end }} + {{ with .Content }} +
+ {{ .Content }} +
+ {{ end }} {{ range .Paginator.Pages }} - {{- .Render "teaser" }} + {{ .Render "teaser" }} {{ end }}
{{ end }} diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json index 30b6f80..b912df0 100644 --- a/layouts/_default/list.json.json +++ b/layouts/_default/list.json.json @@ -3,7 +3,7 @@ {{- $pages := slice -}} {{- if $.IsHome -}} - {{- $mainSections := site.Params.mainSections | default (slice "post") }} + {{- $mainSections := site.Params.mainSections | default (slice "posts") }} {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}} {{- else if $.IsSection -}} {{- $pages = $pctx.RegularPages.ByDate.Reverse -}} diff --git a/layouts/index.html b/layouts/index.html index d3091c7..c82855c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,17 +1,17 @@ {{ define "main" }} -{{- with .Content }} +{{ with .Content }}
{{ . }}

- {{- partial "mini-toc" . -}} -{{- else }} - {{- $mainSections := site.Params.mainSections | default (slice "post") }} - {{ $paginator := .Paginate (where site.RegularPages "Section" "in" $mainSections) }} + {{ partial "mini-toc" . }} +{{ else }} + {{- $mainSections := site.Params.mainSections | default (slice "posts") }} + {{ $paginator := .Paginate (where site.RegularPages.ByDate.Reverse "Section" "in" $mainSections) }}
{{ with .Title }}

{{ . }}

{{ end }} {{ range $paginator.Pages }}{{- .Render "teaser" }}{{ end }}
-{{- end }} -{{- end }} +{{ end }} +{{ end }} -- cgit v1.2.3