diff options
author | Fabian Tamp <fabian.tamp@gmail.com> | 2020-04-14 00:42:19 +0300 |
---|---|---|
committer | Fabian Tamp <fabian.tamp@gmail.com> | 2020-04-14 00:42:19 +0300 |
commit | 549135acfaa75c1e925b9482aef388db268e4f2b (patch) | |
tree | 9be57aa64a77518a1bf801d022491d93389d765f | |
parent | 7a08282a85531d94f53d8015b2519db3e385693c (diff) |
make fitfigure work with pngs
-rw-r--r-- | layouts/shortcodes/fitfigure.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/shortcodes/fitfigure.html b/layouts/shortcodes/fitfigure.html index 48e20b4..d5db3e3 100644 --- a/layouts/shortcodes/fitfigure.html +++ b/layouts/shortcodes/fitfigure.html @@ -2,8 +2,8 @@ {{- $original := .Page.Resources.GetMatch $path -}} {{- if not $original -}} {{- errorf "couldn't find resource for src: %s" $path -}} -{{- else if and ((ne "jpeg" $original.MediaType.SubType) (ne "png" $original.MediaType.SubType)) -}} - {{- errorf "src %s is a %s, expected image/jpg or image/png" $path $original.MediaType -}} +{{- else if and (ne "jpeg" $original.MediaType.SubType) (ne "png" $original.MediaType.SubType) -}} + {{- errorf "src %s is a '%s', expected 'jpeg' or 'png'" $path $original.MediaType.SubType -}} {{- else -}} {{- /* Below is a copy paste of https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/shortcodes/figure.html from Hugo commit aba2647c152ffff927f42523b77ee6651630cd67, with the img tag modified to use srcsets */ -}} {{- /* Note that it presently uses `markdownify` instead of $.Page.RenderString for consistency with Hugo's `figure` shortcode. */ -}} |