diff --git a/layouts/partials/blocks/templates/posts/large.html b/layouts/partials/blocks/templates/posts/large.html index 77eda21448264a4d3d8ba881047f8f9362f962bd..d29b3dacbd02a0e7c52e70be32613749019a1c5e 100644 --- a/layouts/partials/blocks/templates/posts/large.html +++ b/layouts/partials/blocks/templates/posts/large.html @@ -53,7 +53,7 @@ "sizes" site.Params.image_sizes.sections.events.item ) -}} {{- else -}} - {{- partial "commons/image-default.html" (dict "type" "posts") -}} + {{- partial "commons/image-default.html" "posts" -}} {{- end -}} </div> </article> diff --git a/layouts/partials/commons/image-default.html b/layouts/partials/commons/image-default.html index 6bf324e724238ca777c1fd82fe540e167e287bc1..abd7e74a470b26a0083fb97255dd9b24deceb233 100644 --- a/layouts/partials/commons/image-default.html +++ b/layouts/partials/commons/image-default.html @@ -1,9 +1,9 @@ -{{ if and site.Params.events.default_image site.Data.website.default_image }} - - {{ $type := .type}} - {{ $image := site.Data.website.default_image }} +{{ $section_type := .}} +{{ $use_default := (index site.Params $section_type).default_image}} +{{ $image := site.Data.website.default_image }} - {{ with index site.Params.image_sizes.sections $type }} +{{ if and $use_default $image }} + {{ with index site.Params.image_sizes.sections $section_type }} {{ $sizes := .items }} {{- partial "commons/image.html" @@ -12,5 +12,4 @@ "sizes" $sizes ) -}} {{ end }} - {{ end }} \ No newline at end of file diff --git a/layouts/partials/events/event.html b/layouts/partials/events/event.html index 461f866dbe3c28fdbed6882f3c150fd49b02e9c6..cc57c58597762a4ecb8d99815e4596e3117f08a2 100644 --- a/layouts/partials/events/event.html +++ b/layouts/partials/events/event.html @@ -86,7 +86,7 @@ "sizes" site.Params.image_sizes.sections.events.item ) -}} {{- else -}} - {{- partial "commons/image-default.html" (dict "type" "events") -}} + {{- partial "commons/image-default.html" "events" -}} {{- end -}} </div> </article> diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index f987a41e7235edb60180e26a1700f57204e59ce1..ac111562a5c4c05e168820356ee00cda566088c6 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -52,7 +52,7 @@ "sizes" site.Params.image_sizes.sections.events.item ) -}} {{- else -}} - {{- partial "commons/image-default.html" (dict "type" "posts") -}} + {{- partial "commons/image-default.html" "posts" -}} {{- end -}} </div> </article>