jacobian / fmcardgen

Create social media card images from blog post frontmatter.
18 stars 1 forks source link

use a datetime parser on a thing that's already a date fails #12

Open jacobian opened 3 years ago

jacobian commented 3 years ago

YAML strikes again!

I mostly had frontmatter like

date: "2020-01-01"

but one post had

date: 2020-01-01

TIL that YAML has native datetime types - but only in a certain form, otherwise they turn into strings (😠 )

This causes a TypeError: Parser must be a string or character stream, not date

I worked around this in my repo by just making all the dates be strings and parsing them back into dates with the parse option, but it would be better to have the parser handle this ok.