diff --git a/CHANGELOG.md b/CHANGELOG.md index 118c934c..51501a6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Error when attempting to resize SVG assets in page bundles ([#427](https://github.com/jpanther/congo/pull/427)) - Appearance switcher missing `aria-label` ([#438](https://github.com/jpanther/congo/pull/438)) - Article links missing `alt` text and `aria-label` ([#439](https://github.com/jpanther/congo/pull/439)) +- Figure shortcode would not apply `class` or `href` attribtues in some cases ## [2.4.2] - 2022-11-22 diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index bcd105f8..54cff269 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -6,43 +6,37 @@ {{ $caption := .Get "caption" }} {{ $href := .Get "href" }} {{ $class := .Get "class" }} - {{ if findRE "^https?" $url.Scheme }} -
- {{ $altText }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} -
- {{ else }} - {{ $resource := "" }} - {{ if $.Page.Resources.GetMatch ($url.String) }} - {{ $resource = $.Page.Resources.GetMatch ($url.String) }} - {{ else if resources.GetMatch ($url.String) }} - {{ $resource = resources.Get ($url.String) }} - {{ end }} - {{ with $resource }} -
- {{ with $href }}{{ end }} - {{ $altText }} - {{ if $href }}{{ end }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} -
- {{ else }} -
- {{ $altText }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} -
- {{ end }} - {{ end }} + + {{ with $href }}{{ end }} + {{ $altText }} + {{ with $href }}{{ end }} + {{ with $caption }}
{{ . | markdownify }}
{{ end }} + {{ end }}