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

Empty tags in post causes merge failure. #556

Closed
edwardhorsford opened this issue Jun 4, 2019 · 1 comment · Fixed by #557
Closed

Empty tags in post causes merge failure. #556

edwardhorsford opened this issue Jun 4, 2019 · 1 comment · Fixed by #557
Labels
Milestone

Comments

@edwardhorsford
Copy link
Contributor

edwardhorsford commented Jun 4, 2019

I'm unsure if this is quite a bug, but it's an area where eleventy could have a bit better error handling.

If tags exists in frontmatter but is empty (null?), merging with data files fails.

It would help if eleventy coerced empty tags to [] or something.

I think this section would want to be edited to test for null. edit: pr submitted

Why I have empty tags:

I create most of my posts from a template file with a load of front-matter prepopulated, like this:

---
title: TITLE
subtitle: This is the title
date: YYYY-MM-DD
tags: 
location:
venue:
people:
trip:
series:
primaryImage: path/to/the/image.jpg
---

[[CONTENT HERE]]

Up until now, I've always had tags on posts. But I'm now moving to deepDataMerge where my one common tag (to set a post type) is in a data file.

It seems the merge of page and data file fails if tags exists but is empty.

You could argue I don't need it above - I find it helpful to remind me what things I might want to add - and I hope an empty item shouldn't cause a crash.

edwardhorsford added a commit to edwardhorsford/eleventy that referenced this issue Jun 4, 2019
@zachleat zachleat added the bug label Jun 12, 2019
@zachleat zachleat added this to the Next Minor Version milestone Jun 12, 2019
@zachleat
Copy link
Member

Fixed in #557, thank you!

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

Successfully merging a pull request may close this issue.

2 participants