diff --git a/layouts/partials/blocks/templates/posts/large.html b/layouts/partials/blocks/templates/posts/large.html index a67729c6f19cd7d48f69a4a4691e46044a236abc..3dbe90b492e11335fc5635c176ab1ef25380d1d1 100644 --- a/layouts/partials/blocks/templates/posts/large.html +++ b/layouts/partials/blocks/templates/posts/large.html @@ -52,12 +52,12 @@ <div class="media"> {{- if .Params.image -}} {{- partial "commons/image.html" - (dict - "image" .Params.image - "sizes" site.Params.image_sizes.sections.posts.item - ) -}} - {{- else if site.Data.website.default_image -}} - {{- partial "commons/image-default.html" -}} + (dict + "image" .Params.image + "sizes" site.Params.image_sizes.sections.events.item + ) -}} + {{- else -}} + {{- partial "commons/image-default.html" (dict "type" "posts") -}} {{- end -}} </div> </article> diff --git a/layouts/partials/commons/image-default.html b/layouts/partials/commons/image-default.html index c8417e21f9403e25b4c8fb1ff4da85790c46f328..6bf324e724238ca777c1fd82fe540e167e287bc1 100644 --- a/layouts/partials/commons/image-default.html +++ b/layouts/partials/commons/image-default.html @@ -1,4 +1,16 @@ -{{- partial "commons/image.html" - (dict - "image" site.Data.website.default_image - ) -}} \ No newline at end of file +{{ if and site.Params.events.default_image site.Data.website.default_image }} + + {{ $type := .type}} + {{ $image := site.Data.website.default_image }} + + {{ with index site.Params.image_sizes.sections $type }} + {{ $sizes := .items }} + + {{- partial "commons/image.html" + (dict + "image" $image + "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 3ebae0c5d3b31a77a6ebbea41d67e60285a474cf..57eb5a97a5d212aa8a1ca7919f1331dd6fa7a6f9 100644 --- a/layouts/partials/events/event.html +++ b/layouts/partials/events/event.html @@ -83,16 +83,15 @@ {{ end }} </div> <div class="media"> - {{- $event_image := cond (isset .Params "image") .Params.image ( and (.Site.Params.events.default_image) (site.Data.website.default_image)) -}} - {{- if $event_image -}} + {{- if .Params.image -}} {{- partial "commons/image.html" (dict - "image" $event_image + "image" .Params.image "sizes" site.Params.image_sizes.sections.events.item ) -}} - {{/* {{- else if site.Data.website.default_image -}} - {{- partial "commons/image-default.html" -}} */}} - {{- end -}} + {{- else -}} + {{- partial "commons/image-default.html" (dict "type" "events") -}} + {{- end -}} </div> </article> {{ end }} \ No newline at end of file diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index 449df4a73f6d01df56bc500862dabadf762722e0..352d7d88eb15c254bb7a26967e8df482b0dfd0b9 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -53,10 +53,10 @@ {{- partial "commons/image.html" (dict "image" .Params.image - "sizes" site.Params.image_sizes.sections.posts.item + "sizes" site.Params.image_sizes.sections.events.item ) -}} - {{- else if site.Data.website.default_image -}} - {{- partial "commons/image-default.html" -}} + {{- else -}} + {{- partial "commons/image-default.html" (dict "type" "posts") -}} {{- end -}} </div> </article>