From ea2f848064e5babe207f72cba08e44df593c4810 Mon Sep 17 00:00:00 2001 From: Gottfried Mayer Date: Mon, 28 Aug 2023 21:14:06 +0200 Subject: [PATCH 1/2] feat: add nozoom attribute to figure --- layouts/shortcodes/figure.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index a9a4a15b..c916c9dc 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -7,6 +7,7 @@ {{ $caption := .Get "caption" }} {{ $href := .Get "href" }} {{ $class := .Get "class" }} + {{ $nozoom := .Get "nozoom" | default false }} {{ if findRE "^https?" $url.Scheme }}
{{ $altText }} @@ -24,13 +25,13 @@ {{ with $href }}{{ end }} {{ if $disableImageOptimization }} {{ $altText }} {{ else }} {{ else }}
- {{ $altText }} + {{ $altText }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{ end }} From 4790d18acc65ee2903b18a28a59521f6890b5cd9 Mon Sep 17 00:00:00 2001 From: Gottfried Mayer Date: Mon, 28 Aug 2023 21:21:06 +0200 Subject: [PATCH 2/2] feat: docs for nozoom attribute on figure shortcode --- exampleSite/content/docs/shortcodes/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 9199925a..84091d30 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -204,6 +204,7 @@ The `figure` shortcode accepts six parameters: | `caption` | Markdown for the image caption, which will be displayed below the image. | | `class` | Additional CSS classes to apply to the image. | | `href` | URL that the image should be linked to. | +| `nozoom` | `nozoom=true` disables the image "zoom" functionality. This is most useful in combination with a `href` link. | | `default` | Special parameter to revert to default Hugo `figure` behaviour. Simply provide `default=true` and then use normal [Hugo shortcode syntax](https://gohugo.io/content-management/shortcodes/#figure). |