Set and use custom variables in Markdown files #3343
-
I'm trying to set variables within Markdown files so I can reuse them everywhere else (the Markdown files themselves and HTML templates). Say I write an article in Markdown where the file name is Title: My First Review
Date: 2010-12-03 10:20
Category: Review
Description: Following is a review of my favorite mechanical keyboard.
{{ Description }} Ideally, From what I understand, I can use the Would anybody be able to help me out on this? Maybe I missed something in the docs... Edit: Also opened pelican-plugins/jinja2content#8 as I'm not sure where to open it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi Hari. Are you absolutely certain you reviewed the documentation before asking your question, including the Frequently Asked Questions? As far as I am aware, Pelican itself only supports variables in templates and not inside Markdown content. You might find the latter functionality in the form of a plugin, however. The above-linked documentation describes how to handle this behavior in templates. |
Beta Was this translation helpful? Give feedback.
I updated my answer above to reflect that Pelican by itself does not process Jinja directives in Markdown content. How the Jinja2Content plugin works is outside the scope of Pelican core.