markdownpelicanpython-markdown

How can I write comments in the metadata section of a Pelican markdown post?


In Pelican, is it possible to add a comment in the metadata section of a markdown file? Suppose I have a post that looks like this:

Title: Hello World!
Tags: greetings
Date: 2020-01-01

Lorem ipsum sit dolor amet...

Is it possible to add comments to the metadata? For example:

Title: Hello World!
Tags: greetings
Date: 2020-01-01  # This is the first comment.
# This is another comment.

Lorem ipsum sit dolor amet...

The example above does not work because Pelican treats # This is another comment. as a Markdown heading.

How can I comment within the metadata section of Pelican markdown files?


Solution

  • For Markdown content, Pelican delegates processing to the Python-Markdown library. Markdown meta-data is handled by its Meta-Data extension, which I do not believe supports comments within meta-data fields. A cursory examination of tracker issues did not yield any issues related to this question.

    In short, this question does not relate to Pelican itself, but instead to the dependent Python-Markdown library.