From 571b875f4a4b5fb1bc36349311371fb254a2c936 Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Sun, 3 Aug 2025 19:05:33 +0800 Subject: [PATCH] fix(figure): limit link hover area to image only --- layouts/partials/hugo-embedded/shortcodes/figure-default.html | 2 +- layouts/shortcodes/figure.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/hugo-embedded/shortcodes/figure-default.html b/layouts/partials/hugo-embedded/shortcodes/figure-default.html index e74d30be..74b12124 100644 --- a/layouts/partials/hugo-embedded/shortcodes/figure-default.html +++ b/layouts/partials/hugo-embedded/shortcodes/figure-default.html @@ -5,7 +5,7 @@ {{- if .Get "link" -}} - + {{- end -}} {{- $u := urls.Parse (.Get "src") -}} diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 0b429187..35f5e331 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -11,7 +11,7 @@ {{- $nozoom := .Get "nozoom" | default false -}}
- {{- with $href }}{{ end -}} + {{- with $href }}{{ end -}} {{- if findRE "^https?" $url.Scheme }} {{ $altText }} {{- else }} @@ -45,7 +45,7 @@ {{ $altText }} {{- end }} {{- end }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} {{ if $href }}
{{ end }} + {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{- end -}}