-
-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relative image link inside formatted post excerpt with eleventy-img #3570
Comments
Haven’t had the time to go through your full issue yet but I do want to call out the work in #3573 real quick! |
Tried the new passthrough copy mode in but got same error as I had before originally.
It should be something to do with image plugin instead as I wasn't using any passthrough copy config anyway as far as I understand. |
Operating system
macOS Monterey 12.7.6
Eleventy
3.0.0
Describe the bug
In order to show summary of my posts in post list, I'm using a package called
truncate-html
as a shortcode. (for keeping the HTML format with proper tag stripping) I'm also using Transform method ineleventy-img
. There's no problem when I reference absolute image link but relative image link as it's explained why in the Image plugin docs.eleventy-img
gives an error if any relative image link is inside the range to be truncated/excerpted. Also I tried settingurlPath
but got same error.Error Log
In the relative link section from the doc:
Normally, I feed my truncation shortcode with templateContent which has relative links before the transformation. I thought if there's a way to get a version of templateContent that has all transformation changes written so I can truncate the result of the eleventy-img transform. Would it be somehow ignorable by
eleventy-img
afterwards?Truncate/Excerpt Shortcode
postlist.njk
Image Plugin Config
Directory Structure with Relevant Files/Folders
Reproduction steps
git clone https://github.com/egeesin/local-image-in-post-excerpt-test local-image-in-post-excerpt-test/
npm i
npx @11ty/eleventy
<img>
fromcontent/blog/post-with-local-img/index.md
to see the build.Expected behavior
I want relative link to work in both post itself and the excerpt. I want
eleventy-img
to transform my links in a way that it's only relative to my post directory but to the directory of pages/templates where excerpt have been used.Reproduction URL
https://github.com/egeesin/local-image-in-post-excerpt-test
Screenshots
No response
The text was updated successfully, but these errors were encountered: