You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I am using the 11ty base template which defines the image short code as follows:
eleventyConfig.addAsyncShortcode("image",asyncfunctionimageShortcode(src,alt,widths,sizes){// Full list of formats here: https://www.11ty.dev/docs/plugins/image/#output-formats// Warning: Avif can be resource-intensive so take care!letformats=["avif","webp","auto"];letinput;if(isFullUrl(src)){input=src;}else{input=relativeToInputPath(this.page.inputPath,src);}letmetadata=awaiteleventyImage(input,{widths: widths||["auto"],
formats,outputDir: path.join(eleventyConfig.dir.output,"img"),// Advanced usage note: `eleventyConfig.dir` works here because we’re using addPlugin.});// TODO loading=eager and fetchpriority=highletimageAttributes={
alt,
sizes,loading: "lazy",decoding: "async",};returneleventyImage.generateHTML(metadata,imageAttributes);});
I am using the shortcode like so:
{% image "./my-image.jpg", "Alt text" %}
What is the shortest way to get this image to display at a smaller size but hyperlink to the full size? Modifying the default value of ["auto"] for the width field in the default site's image shortcode implementation I am seeing the 600px image used in the generated blog post. However, I still have the full size image I'd like to link to. Is there a way to do this out of the box?
The text was updated successfully, but these errors were encountered:
Hello I am using the 11ty base template which defines the
image
short code as follows:I am using the shortcode like so:
What is the shortest way to get this image to display at a smaller size but hyperlink to the full size? Modifying the default value of
["auto"]
for thewidth
field in the default site's image shortcode implementation I am seeing the 600px image used in the generated blog post. However, I still have the full size image I'd like to link to. Is there a way to do this out of the box?The text was updated successfully, but these errors were encountered: