doks: bug: figures with links cause build errors
Description
Using a figure with a link causes a build error. in 0.5.0. The issue appears to be here: https://github.com/h-enk/hyas-images/blob/master/layouts/partials/helpers/lib-output/image-handling/thumbnail-or-full-picture.html#L94
This seems to be because the helpers/link-open partial doesn’t exist.
Steps to reproduce
Use the following example in 0.5.0: {{< figure link="https://www.istockphoto.com/" src="https://media.istockphoto.com/photos/young-woman-watches-sunrise-outside-camping-tent-picture-id1248575497?s=612x612" height="50" >}}
Expected result
Should create an image with a link.
Actual result
Error Output
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio Error: Error building site: "content\en\docs\prologue\commands.md:26:1": failed to render shortcode "figure": failed to process shortcode: "node_modules\@hyas\images\layouts\shortcodes\figure.html:1:4": execute of template failed: template: shortcodes/figure.ht ml:1:4: executing "shortcodes/figure.html" at <partial "helpers/wrapped-image" (dict "width" (.Get "width") "height" (.Get "height") "alt" (.Get "alt") "title" (.Get "title") "image" (partial "helpers/lib/image-handling/find-image-src" (dict "src" (.Get "src") "page" .Page "getRelative" (.Get "getRelative" | default true) "ignoreBundleAssets" (.Get "ignor eBundleAssets" | default false) "ignoreSiteAssets" (.Get "ignoreSiteAssets" | default false) "ignoreStaticImages" (.Get "ignoreStaticImages" | default true))) "page" .Page "link" (.Get "link") "target" (.Get "target") "rel" (.Get "rel") "imageWrapper" (default "figure" (.Get "imageWrapper")) "caption" (.Get "caption") "attr" (.Get "attr") "attrLink" (.Get "attrLink") "class" (.Get "class") "singleSize" (.Get "singleSize") "thumbnails" (.Get "thumbnails"))>: error calling partial: "node_modules\@hyas\images\layouts\partials\helpers\wrapped-image.html:109:8": execute of template failed: template: partials/helpers/wrapped-image.html:109:8: executing "partials/h elpers/wrapped-image.html" at <partial "helpers/lib-output/image-handling/thumbnail-or-full-picture" $pictureOptions>: error calling partial: "node_modules\@hyas\images\layouts\partials\helpers\lib-output\image-handling\thumbnail-or-full-picture.html:94:20": execute of template failed: template: partials/hel pers/lib-output/image-handling/thumbnail-or-full-picture.html:94:20: executing "partials/helpers/lib-output/image-handling/thumbnail-or-full-picture.html" at <partial "helpers/link-open" (dict "page" . "destination" $linkHref "class" $inLinkClass "close" false "target" $inTarget "rel" $rel "destinationNoFind" true)>: error calling partial: partial "helper s/link-open" not found Built in 1152 msEnvironment
Environment Output
``` npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.@hyas/doks@0.5.0 precheck npm version
npm WARN config global --global, --local are deprecated. Use --location=global instead.
{
‘@hyas/doks’: ‘0.5.0’,
npm: ‘8.11.0’,
node: ‘16.15.1’,
v8: ‘9.4.146.24-node.21’,
uv: ‘1.43.0’,
zlib: ‘1.2.11’,
brotli: ‘1.0.9’,
ares: ‘1.18.1’,
modules: ‘93’,
nghttp2: ‘1.47.0’,
napi: ‘8’,
llhttp: ‘6.0.4’,
openssl: ‘1.1.1o+quic’,
cldr: ‘40.0’,
icu: ‘70.1’,
tz: ‘2021a3’,
unicode: ‘14.0’,
ngtcp2: ‘0.1.0-DEV’,
nghttp3: ‘0.1.0-DEV’
}
@hyas/doks@0.5.0 check exec-bin node_modules/.bin/hugo/hugo version
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (9 by maintainers)
Commits related to this issue
- Remove dependency on link-handling module Closes #34 and when pulled downstream will also fix https://github.com/h-enk/doks/issues/820 Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca... — committed to danielfdickinson/image-handling-mod-hugo-dfd by danielfdickinson 2 years ago
- Add per-image class setting for shortcode Per https://github.com/h-enk/doks/issues/820#issuecomment-1180747925 I had missed this previously. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgar... — committed to danielfdickinson/image-handling-mod-hugo-dfd by danielfdickinson 2 years ago
- fix: build fails when figure has link This fixes an issue where if a figure image has a link the hugo build fails. Fixes #820 — committed to james-d-elliott/doks by james-d-elliott 2 years ago
- fix: build fails when figure has link This fixes an issue where if a figure image has a link the hugo build fails. Fixes #820 — committed to musamaanjum/musamaanjum.github.io by james-d-elliott 2 years ago
- Remove dependency on link-handling module Closes #34 and when pulled downstream will also fix https://github.com/h-enk/doks/issues/820 Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca... — committed to danielfdickinson/image-handling-mod-hugo-dfd by danielfdickinson 2 years ago
- Add per-image class setting for shortcode Per https://github.com/h-enk/doks/issues/820#issuecomment-1180747925 I had missed this previously. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgar... — committed to danielfdickinson/image-handling-mod-hugo-dfd by danielfdickinson 2 years ago
Your comment actually allowed me to solve my issue, I’m by no means good at CSS/Styles/HTML, but setting the width instead actually fixes my particular issue!