diff --git a/hugo.yaml b/hugo.yaml index eef804a05..903d2237e 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -120,6 +120,11 @@ params: show_name: true sitemap: ignore_children: false + layouts: + alternate: + more: true + grid: + more: false categories: index: layout: grid # alternate | cards | grid | large | list @@ -419,9 +424,6 @@ params: progression: true key_figures: animated: true - pages: - alternate: - more: true posts: slider: arrows: true diff --git a/layouts/partials/GetTypeParamWithDefault b/layouts/partials/GetTypeParamWithDefault new file mode 100644 index 000000000..73d09a75a --- /dev/null +++ b/layouts/partials/GetTypeParamWithDefault @@ -0,0 +1,6 @@ +{{ $param := partial "GetSiteParamWithDefault" (dict + "param" (printf "%s.%s" .type .param) + "default" (printf "default.%s" .param) + ) }} + +{{ return $param }} \ No newline at end of file diff --git a/layouts/partials/events/partials/event.html b/layouts/partials/events/partials/event.html index 4a32cede6..bbdfddf02 100644 --- a/layouts/partials/events/partials/event.html +++ b/layouts/partials/events/partials/event.html @@ -82,7 +82,7 @@ "kind" "events" )}} {{ if eq $layout "large" }} - + {{ partial "events/partials/event/more.html" . }} {{ end }} {{ end }} @@ -94,8 +94,8 @@ )}} {{- end -}} - {{ if $with_more }} - {{ partial "commons/item/more.html" . }} + {{ if and $with_more (ne $layout "large") }} + {{ partial "events/partials/event/more.html" . }} {{- end -}}
diff --git a/layouts/partials/events/partials/event/more.html b/layouts/partials/events/partials/event/more.html new file mode 100644 index 000000000..42f40badc --- /dev/null +++ b/layouts/partials/events/partials/event/more.html @@ -0,0 +1 @@ +{{ partial "commons/item/more.html" . }} diff --git a/layouts/partials/pages/partials/layouts/alternate/alternate.html b/layouts/partials/pages/partials/layouts/alternate/alternate.html index 2efdee57f..bdfee410f 100644 --- a/layouts/partials/pages/partials/layouts/alternate/alternate.html +++ b/layouts/partials/pages/partials/layouts/alternate/alternate.html @@ -4,6 +4,10 @@ "level" $heading_level "attributes" "class='page-title'" )}} +{{ $with_more := partial "GetTypeParamWithDefault" (dict + "param" "layouts.alternate.more" + "type" "pages" + ) }}
{{ range .pages }} @@ -36,8 +40,8 @@ )}} {{ end }} - {{ if site.Params.blocks.pages.alternate.more }} - + {{ if $with_more }} + {{ partial "pages/partials/page/more.html" . }} {{ end }} {{ if $options.image }} diff --git a/layouts/partials/pages/partials/layouts/cards/cards.html b/layouts/partials/pages/partials/layouts/cards/cards.html index 9a3d80af0..426650950 100644 --- a/layouts/partials/pages/partials/layouts/cards/cards.html +++ b/layouts/partials/pages/partials/layouts/cards/cards.html @@ -32,7 +32,7 @@ )}} {{ end }} - + {{ partial "pages/partials/page/more.html" . }} {{ if $options.image }} {{- partial "pages/partials/page/page-media.html" . -}} diff --git a/layouts/partials/pages/partials/layouts/grid/grid.html b/layouts/partials/pages/partials/layouts/grid/grid.html index 256e8ad26..6a64f6c94 100644 --- a/layouts/partials/pages/partials/layouts/grid/grid.html +++ b/layouts/partials/pages/partials/layouts/grid/grid.html @@ -1,9 +1,14 @@ {{ $options := .options }} {{ $heading_level := .heading_level | default 3 }} {{ $heading_tag := partial "GetHeadingTag" (dict - "level" $heading_level - "attributes" "class='page-title'" -)}} + "level" $heading_level + "attributes" "class='page-title'" + )}} +{{ $with_more := partial "GetTypeParamWithDefault" (dict + "param" "layouts.grid.more" + "type" "pages" + ) }} + {{ with .pages }}
{{ range . }} @@ -38,6 +43,11 @@ "kind" "page" )}} {{ end }} + + {{ if $with_more }} + {{ partial "pages/partials/page/more.html" . }} + {{ end }} + {{ if $options.image }} {{- partial "pages/partials/page/page-media.html" . -}} {{ end }} diff --git a/layouts/partials/pages/partials/layouts/large/large.html b/layouts/partials/pages/partials/layouts/large/large.html index 0178c98e5..aee87ff34 100644 --- a/layouts/partials/pages/partials/layouts/large/large.html +++ b/layouts/partials/pages/partials/layouts/large/large.html @@ -32,7 +32,7 @@ )}} {{ end }} - + {{ partial "pages/partials/page/more.html" . }}
{{- if and $options.image .Params.image -}} diff --git a/layouts/partials/pages/partials/page/more.html b/layouts/partials/pages/partials/page/more.html new file mode 100644 index 000000000..42f40badc --- /dev/null +++ b/layouts/partials/pages/partials/page/more.html @@ -0,0 +1 @@ +{{ partial "commons/item/more.html" . }}