diff --git a/wowchemy/layouts/shortcodes/callout.html b/wowchemy/layouts/shortcodes/callout.html index f509381c..e1a41b27 100644 --- a/wowchemy/layouts/shortcodes/callout.html +++ b/wowchemy/layouts/shortcodes/callout.html @@ -1,5 +1,5 @@
- {{ .Inner }} + {{ .Inner | markdownify | emojify }}
diff --git a/wowchemy/layouts/shortcodes/figure.html b/wowchemy/layouts/shortcodes/figure.html index ad90c873..00b23cc0 100644 --- a/wowchemy/layouts/shortcodes/figure.html +++ b/wowchemy/layouts/shortcodes/figure.html @@ -1,5 +1,7 @@ {{/* Figure Shortcode for Wowchemy. */}} {{/* Load image from page dir falling back to media library at `assets/media/` and then to remote URI. */}} +{{/* Note: Uses `{{-` to unindent HTML so that Figure shortcode can be nested within a `{{%` Markdown shortcode, + such as Callout, without the HTML being rendered as a Markdown code block. */}} {{ $destination := .Get "src" }} {{ $caption := .Get "caption" | default (.Get "title") | default "" }}{{/* Support legacy `title` option. */}} @@ -16,13 +18,13 @@ {{- if $img -}} {{ $isSVG := eq $img.MediaType.SubType "svg" }} - {{ if $isSVG }} + {{ if $isSVG -}} {{ $alt }} - {{ else }} + {{- else }} {{- $img_lg := $img.Fit "1200x1200" -}} {{- $img_md := $img_lg.Fit "760x760" -}}{{/* Match `.docs-article-container` max-width */}} {{- $img_sm := $img_md.Fit "400x400" -}} @@ -37,7 +39,7 @@ height="{{ $height }}" loading="lazy" {{ if $zoom }}data-zoomable{{end}} /> - {{ end }} + {{- end }} {{- else -}} {{ $alt }} @@ -45,9 +47,9 @@ {{ if $caption }} {{/* Localize the figure numbering (if enabled). */}} - {{ $figure := split (i18n "figure" | default "Figure %d:") "%d" }} + {{- $figure := split (i18n "figure" | default "Figure %d:") "%d" -}} {{ $caption | markdownify | emojify }} - {{ end }} + {{- end -}}