markdown error in nikola

July 2017 / tech

If you're trying to generate Markdown posts using Nikola, and you're getting an error like:

[2017-07-24T07:53:47Z] ERROR: Nikola: ValueError: Missing date in file posts/vim22.md

Or something like:

ValueError: Unrecognized date/time: ''


raise ValueError("String does not contain a date.")

At least for me, it was because the metadata at the top of the post wasn't being recognized. Switching it up to match Nikola's regular reST-style (optionally contained in HTML comments) worked for me. From this post:

.. title: markdown error in nikola
.. slug: markdown-error-in-nikola
.. date: 2017-07-24 00:45:37 UTC-07:00
.. type: text