-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Request to use relative paths #185
Comments
I feel like I experienced this issue as well. I'd try using your full project root |
As sygint mentioned you need to provide the image's full path as the src value's, in your case it needs to be: But since you said it's not printing any errors and it outputs the same tag as in the source file I guess it's not being parsed correctly. Are you calling the eleventy-image tag in a .webc file? If not, you'll probably need to wrap the eleventy-image tag with the Render plugin: https://www.11ty.dev/docs/languages/webc/#use-the-render-plugin or change the htmlTemplateEngine to 'webc': https://www.11ty.dev/docs/languages/webc/#pre-process-html-input-as-webc. |
full path worked for me. |
I, too, woud love to use relative paths |
Related: #208 adds support for relative paths in the Eleventy Transform. More to come here! |
Agreed, it would be nice if the <!-- Specify image src relative to the input directory -->
<img webc:is="eleventy-image" src="/img/something.jpg" ...> |
I have followed the tutorial here, but it isn't doing anything at all. And no errors.
Here is my .eleventy.js:
Here is the tag I am using:
<eleventy-image src="hero.jpg" alt=""></eleventy-image>1
hero.jpg
exists at.src/img/hero.jpg
.Here is my package.json:
The site builds but puts nothing in
_site/img/
. Inspecting the HTML on my live site, it's outputting the tag exactly as I have it in src:<eleventy-image src="hero.jpg" alt=""></eleventy-image>
Any ideas what I am doing wrong?
The text was updated successfully, but these errors were encountered: