aboutsummaryrefslogtreecommitdiff
path: root/generators/hugo/themes
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2019-05-29 10:33:08 -0400
committerThedro Neely <thedroneely@gmail.com>2019-05-29 10:33:08 -0400
commitae8c0b1634236a442716a2e191ecab968031dc7b (patch)
tree0315595389b156004cf46e436597809abd8a045c /generators/hugo/themes
parent446859ad81ff741394ab71c29f57b613f602c212 (diff)
downloadthedroneely.com-ae8c0b1634236a442716a2e191ecab968031dc7b.tar.gz
thedroneely.com-ae8c0b1634236a442716a2e191ecab968031dc7b.tar.bz2
thedroneely.com-ae8c0b1634236a442716a2e191ecab968031dc7b.zip
hugo/_default/summary: Use imageConfig to get image height and width
Diffstat (limited to 'generators/hugo/themes')
-rw-r--r--generators/hugo/themes/tdro/layouts/_default/summary.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/generators/hugo/themes/tdro/layouts/_default/summary.html b/generators/hugo/themes/tdro/layouts/_default/summary.html
index 1a084da..481db6b 100644
--- a/generators/hugo/themes/tdro/layouts/_default/summary.html
+++ b/generators/hugo/themes/tdro/layouts/_default/summary.html
@@ -2,7 +2,13 @@
<div class="column is-5 has-text-centered">
<a href="{{ .Permalink }}">
- <img class="image__thumbnail" alt="{{ .Title }}" src="{{ partial "article-image.html" . }}">
+
+ {{ if (fileExists (print "public/" (replaceRE .Site.BaseURL "" (partial "article-image.html" .)))) }}
+ {{ $image := imageConfig (print "public/" (replaceRE .Site.BaseURL "" (partial "article-image.html" .))) }}
+ <img class="image__thumbnail" alt="{{ .Title }}" src="{{ partial "article-image.html" . }}"
+ height="{{ $image.Height }}" width="{{ $image.Width }}"/>
+ {{ end }}
+
</a>
</div>