diff options
author | Ivan Boothe <git@rootwork.org> | 2022-04-08 01:59:50 +0300 |
---|---|---|
committer | Ivan Boothe <git@rootwork.org> | 2022-04-08 01:59:50 +0300 |
commit | dcb38c422bb25d2e94cb4971f77ee3fbbe6247a7 (patch) | |
tree | d016430806e7898063f68e0759a0b55d4fc77cd6 | |
parent | f940cc910a6919e072e406fb25c39b78cc8705dd (diff) |
passing title of post as alt text in content-list situations
Signed-off-by: Ivan Boothe <git@rootwork.org>
-rw-r--r-- | layouts/partials/excerpt.html | 2 | ||||
-rw-r--r-- | layouts/partials/image.html | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/layouts/partials/excerpt.html b/layouts/partials/excerpt.html index bc7a9f3..8bdaa79 100644 --- a/layouts/partials/excerpt.html +++ b/layouts/partials/excerpt.html @@ -9,7 +9,7 @@ {{- with .Params.thumbnail }} <div class="excerpt_footer partition"> <div class="excerpt_thumbnail"> - {{- partial "image" (dict "file" . "type" "thumbnail") }} + {{- partial "image" (dict "file" . "alt" $.Title "type" "thumbnail") }} </div> {{ else }} <div class="excerpt_footer"> diff --git a/layouts/partials/image.html b/layouts/partials/image.html index f62618d..8aed4b6 100644 --- a/layouts/partials/image.html +++ b/layouts/partials/image.html @@ -1,5 +1,8 @@ {{- $file := .file -}} -{{- $alt := .Text -}} +{{- $alt := .alt -}} +{{- if not $alt -}} + {{- $alt = .Text -}} +{{- end -}} {{- $cap := .Title -}} {{- $scratch := newScratch -}} {{- $scratch.Set "classes" "image_figure" -}} |