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

Deduplicate tags when using deepDataMerge #1876

Merged
merged 1 commit into from
Jul 8, 2021
Merged

Deduplicate tags when using deepDataMerge #1876

merged 1 commit into from
Jul 8, 2021

Conversation

jakemulley
Copy link
Contributor

Resolves #1810.

As described in #1810, tags can be duplicated through a data deep merge if they appear in more than one place.

I can't think of a reason why anyone needs a tag to appear more than once within the data cascade, so this uses new Set to deduplicate the output.

Hopefully this is OK!

@zachleat zachleat merged commit 1a0375d into 11ty:master Jul 8, 2021
@zachleat
Copy link
Member

zachleat commented Jul 8, 2021

Lovely PR, thank you!

@zachleat zachleat added this to the Eleventy 1.0.0 milestone Jul 8, 2021
@jakemulley jakemulley deleted the fix-1810 branch July 8, 2021 13:06
@paulrobertlloyd
Copy link
Contributor

@zachleat Just a note that when I upgraded to canary.39, I got an error building my site. This is because I was using tags: false on some of my pages, instead of what I should have been using, tags: []. Do we need to guard against cases where data.tags isn’t an array?

@pdehaan
Copy link
Contributor

pdehaan commented Jul 31, 2021

Interesting! Looks like permalink: false "worked" in 0.12.1, but throws an error in 1.0.0-canary.39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deduplicate tags after merging
4 participants