Generate collections / add pages to collections based on eleventyComputed.tags content
#4141
Closed
olets
started this conversation in
Enhancement Queue
Replies: 2 comments
-
|
Taken from https://www.11ty.dev/docs/data-computed/: Note It is important to note that Computed Data is computed right before templates are rendered. Therefore Computed Data cannot be used to modify the special data properties used to configure templates (e.g. layout, pagination, tags etc.). These restrictions may be relaxed over time. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
#4029 is the home base for this one! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Colletions are generated and pages are added to collections for tags added in the frontmatter
tagsfield, but not for tags added witheleventyIncluded.Here's a close-to-minimal 3.0.0 repro. Compare
src/index.11ty.jstodist/index.html.https://stackblitz.com/edit/eleventy-dynamic-collections?file=src%2Findex.11ty.js
Describe the solution you'd like
Take
eleventyComputed.tagsinto account when collecting pages.Describe alternatives you've considered
There might be some way to hack this with a plugin. Gather up the tags, export them, then loop over them in the Eleventy config and manually create new collections. Feels like it would be tricky to go back and add the appropriate pages to the collection. Maaaybe eleventy-plugin-pack11ty's auto-collection would is relevant https://github.com/search?q=repo%3Anhoizey%2Feleventy-plugin-pack11ty%20autocollections&type=code.
Would much prefer to support doing this from within one Eleventy data file.
Additional context
This is similar to the title of
but the request there is for dynamic tags added in the frontmatter
tagsfield.Possible one enhancement would cover both, but they feel different. Close this issue if I'm wrong to think they're separate!
//
This would get us closer to
Could parse the inputPath and add dynamic tags.
Beta Was this translation helpful? Give feedback.
All reactions