Skip to content

Can eleventy-img recognize images it processed from another page and not process it again like a new image? #281

@GoOz

Description

@GoOz

Hello there,

I'm not sure if this is an actual issue, a behaviour by design or if I'm just doing it wrong but on my portfolio website my homepage is displaying a grid of my photos with a link on their dedicated page.

The picture in those pages is processed as intended and will end up in the folder of the page.

The thumbnail pictures though are processed again and stored in the img folder at the root of my website.

So basically every picture is processed twice.

There is the code I use for the grid:

<li class="post">
	<a href="{{ post.url }}">
		{% if post.data.photo %}
		<img src="/{{ post.url }}/{{ post.data.photo }}" alt="{{ post.data.photo_alt }}" sizes="(min-width: 50em) 50vw, 100vw">
		{% endif %}
		<h2 class="post-title">{{ post.data.title }}</h2>
		</a>
</li>

I'm guessing the plugin doesn't check if it processed the picture already.
And it would be harmless on a small website but mine is already 500+ pictures which, as you may expect, makes the image processing time twice longer than it should and… needs almost twice the disk space it should.

Is there a way to avoid that?


eleventy: v3.0.0
eleventy-img: v6.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions