Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/humrochagf/colordrop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHumberto Rocha <humrochagf@gmail.com>2022-05-28 01:52:02 +0300
committerHumberto Rocha <humrochagf@gmail.com>2022-05-28 01:52:02 +0300
commit6bba2cf88333db35574312430d065408783248e7 (patch)
tree1d76648c359e81ecb3ab776ff92a69cbcc36c7d2
parent488f4142d11f3e6cd650bae67d72f4b8d9a03a53 (diff)
Fix backwards compatibility on images to accept image as list of paths
-rw-r--r--layouts/_default/taxonomy.html11
-rw-r--r--layouts/blog/list.html11
2 files changed, 18 insertions, 4 deletions
diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html
index a90182e..c372527 100644
--- a/layouts/_default/taxonomy.html
+++ b/layouts/_default/taxonomy.html
@@ -21,13 +21,20 @@
{{ $image := index .Params.images 0 }}
<a href="{{ .Permalink }}">
<img
- src="{{ $image.src | safeURL }}"
+ {{ if reflect.IsMap $image }}
+ src="{{ $image.src | safeURL }}"
+ {{ else }}
+ src="{{ $image | safeURL }}"
+ {{ end }}
alt="{{ .Title }}"
title="{{ .Title }}"
/>
</a>
- {{ if ne nil $image.attribution }}
+ {{ if and
+ (reflect.IsMap $image)
+ (ne nil $image.attribution)
+ }}
<div class="attribution">
{{ print $image.attribution | safeHTML }}
</div>
diff --git a/layouts/blog/list.html b/layouts/blog/list.html
index f253233..4cc5da6 100644
--- a/layouts/blog/list.html
+++ b/layouts/blog/list.html
@@ -21,13 +21,20 @@
{{ $image := index .Params.images 0 }}
<a href="{{ .Permalink }}">
<img
- src="{{ $image.src | safeURL }}"
+ {{ if reflect.IsMap $image }}
+ src="{{ $image.src | safeURL }}"
+ {{ else }}
+ src="{{ $image | safeURL }}"
+ {{ end }}
alt="{{ .Title }}"
title="{{ .Title }}"
/>
</a>
- {{ if ne nil $image.attribution }}
+ {{ if and
+ (reflect.IsMap $image)
+ (ne nil $image.attribution)
+ }}
<div class="attribution">
{{ print $image.attribution | safeHTML }}
</div>