Closed spaceninja closed 1 year ago
Oh, I missed something! I forgot that any filters you register are available in your webc files, so I was able to make imgPath
into a filter and then this works:
<img webc:is="eleventy-image" :src="imgPath('feature/example.jpg')" alt="Featured Image">
In the eleventy-base-blog package, there's a clever
relativeToInputPath
function that I've updated to allow me to pass only the image filename to the universal shortcode:Then in my markdown files, I can just do this to load an image in
src/_assets/_images/feature/example.jpg
:Recently, I tried to update my blog to use webc as the markdown templating language, but I ran into problems when I updated the image syntax to webc:
This fails because it can't find the image. But I don't see how I can do something similar to what the blog does to update the relative image path. Is there something I can do to avoid having to put the full image path when using webc?