Skip to content
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

Custom template engine option to exclude from collections.all #2854

Closed
zachleat opened this issue Mar 9, 2023 · 4 comments
Closed

Custom template engine option to exclude from collections.all #2854

zachleat opened this issue Mar 9, 2023 · 4 comments
Labels
enhancement feature: 🤟 custom template languages eleventyConfig.addExtension API needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved.

Comments

@zachleat
Copy link
Member

zachleat commented Mar 9, 2023

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, #2850 (comment) 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

@patrulea
Copy link

It could also look like having control over what goes into the collection by handling what it’s aggregating. Maybe:

A: Compose an array with template (or output) extensions. Kinda like templateFormats.
B: Opt in or out of extensions. Kinda like ignores.add and ignores.delete.

@zachleat zachleat added the feature: 🤟 custom template languages eleventyConfig.addExtension API label Apr 19, 2023
@elmuerte
Copy link

Both eleventyExcludeFromCollections and pagination:addAllPagesToCollections could also use some granular controls.

For example:

pagination:
  addAllPagesToCollections: true
tags:
  - foobar
  - quux

This will add it to all collections

pagination:
  addAllPagesToCollections:
    - all
    - foobar
tags:
  - foobar
  - quux

That would only add it to the "all" and "foobar" collections, but not to the "quux" collection.

For eleventyExcludeFromCollections the similar approach could be used. But it becomes a bit more tricky. true would exclude it from everything [all, foobar] would exclude it from the "all" and "foobar" collection. But what if you want to exclude it from all collections, except for "quux"? Maybe add a eleventyIncludeInCollections which defaults to true and does the exact opposite?

@zachleat
Copy link
Member Author

zachleat commented Jun 26, 2024

Related #2830 and #2482 both shipping with 3.0

@zachleat zachleat added the needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved. label Jul 10, 2024
@zachleat
Copy link
Member Author

By default this repo closes enhancement request issues and places them in a queue for folks to upvote. We do this to avoid a large build-up of open issues. We got this idea from the lodash project.

Don’t forget to upvote the first comment with 👍 to register your vote! You can view the current enhancement backlog.

@zachleat zachleat closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature: 🤟 custom template languages eleventyConfig.addExtension API needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved.
Projects
None yet
Development

No branches or pull requests

3 participants