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 ms

Environment

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

Most upvoted comments

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!