Skip to content
Discussion options

You must be logged in to vote

Good news, I think your (item.data.keywords || []).forEach(keyword => tagSet.add(keyword)); code is correct.
Bad news, I don't think that works.

When you set tags in your front matter (or data file), it will automatically create a matching collections.<tag> collection for you.
If you use a different front matter key (like keywords) it won't.
So in my simplified test case (based on your code above), we…:

  1. paginate over the custom collections.tagList (which was defined in the .eleventy.js config file)
  2. set an arbitrary alias of tag
  3. loop over the collections[tag] (which will not work since we are using keywords alias in front matter instead of tags)
  4. dump out the contents of {{ collections.tag…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pdehaan
Comment options

pdehaan Sep 8, 2022
Collaborator

@Julianoe
Comment options

Answer selected by Julianoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants