Added null-coalescing check for published date
This small adjustment checks that there is a published date set on the incoming webmention.
If published is null, then it is set to the same datestamp as wm-received.
This deals with errors created in Hugo where "published": null causes a failure to build.
Thanks for this PR!
Sent a PR to match up the whitespace w/ the rest of the file (unexpanded tabs, soorrry).
I also wanted to chat a bit about this change because I thought about adding this the first time through but decided to leave it out.
My thinking at the time was that if the original is missing a 'published' property, that might be intentional. For example, a reference page or something else non-date-y. It felt somewhat misleading to use the wm-received date in place of a published date, since it could be any time, as a mention doesn't have to be sent by the original publisher.
In my current templates, I check whether published is set before using it, and just omit it if absent.
I may be worrying too much, so I'd love to hear your thoughts!
Merged your AWFUL whitespace.
Hey Marty,
I didn't see your comment until this morning.
I can understand why you chose this path; it does make sense that the published date is available only where that data has relevance. I guess my templating skills aren't as good as yours.