eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

Custom template engine option to exclude from `collections.all`

Open zachleat opened this issue 2 years ago • 3 comments

Like eleventyExcludeFromCollections but set in https://www.11ty.dev/docs/languages/custom/ somewhere.

cc @5t3ph

https://github.com/5t3ph/eleventy-plugin-sass-lightningcss#usage

⚠️ Important: The files will end up in collections.all and appear in places like RSS feeds where you may be using the "all" collection. To prevent that, https://github.com/11ty/eleventy/discussions/2850#discussioncomment-5254892 is to create a directory data file to exclude your Sass files.

Just thinking out loud: maybe it’d be nice to have a collections entry for HTML-only stuff? Or even more breakingly, should collections.all include non-HTML files (probably not this, that’s too big of a breaking change)?

Related: https://www.11ty.dev/docs/languages/custom/#outputfileextension

zachleat avatar Mar 09 '23 19:03 zachleat

Can you submit the change as a PR with some additional tests?

Keats avatar Jun 23 '24 18:06 Keats

@Keats will do :) would you also be interested in using named regex groups instead of indexed ones? I find it more readable and more flexible

kytta avatar Jun 25 '24 10:06 kytta

Sure go for it

Keats avatar Jun 25 '24 10:06 Keats