PassthroughCopy, eleventyignore, and eleventy-image HTML Transform #3620
Unanswered
SunfireWeb
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey team. I've been working with eleventy for a while now and I really love it. But I'm trying to better understand how parts of it work (now that I have a complex site to truly test).
So, I have a directory called
files
that includes a variety of filetypes, including HTML, PDF, PPTX, and some older formats as well. These are generally archive items that we want to have available to site visitors, but being archive, they don't actually have any 11ty tooling or shortcodes or anything in them, nor do they use the templating in use for the rest of the modern site. The HTML files are truly stand-alone in this case.I've included this directory as a PassthroughCopy item in
eleventy.js
and that seems to work correctly (the/files/
directory is copied to_site
during deploy and all files are available at the expected URLs).However, I am noticing that the HTML files in this directory are also being processed by 11ty...
Example from my Netlify deploy log:
While this doesn't seem to really slow the build down in particular, it seems somewhat unnecessary while also possibly causing me issues as I try to implement the new eleventy-image HTML Transform. Because that plugin, as stated in the docs, searches for ANY
<img>
tag to process, it has been going through the/files/
directory and trying to handle some of these older content pages which, frankly, aren't worth optimizing.So, I guess, two questions:
/files/
directory to the.eleventyignore
file, would it still passthrough copy the directory just not process the html files like it does now?/files/
directory to the.eleventyignore
file, would eleventy-image then NOT process that content?And I guess one subsequent question related specifically to eleventy-image:
Besides adding the
eleventy:ignore
attribute to every image tag I want the plugin to ignore (which would be incredibly tedious at this point), is there any other way to define what images I want the plugin to skip processing?I was previously using custom shortcodes and was hoping the "easiest method to configure" might be a smoother option, but it seems the ability to more directly target only the images I want processed is better in this case...
Beta Was this translation helpful? Give feedback.
All reactions