To add Markdown to any HTML file in Jekyll, capture it into a variable and print that variable using markdownify. That is:
You can also use kramdown as your Markdown processor: it supports GitHub-like code fencing and many useful Markdown extensions.
If you do, there's a great alternative. Name your HTML files as .md
, which is fine, because Markdown will ignore HTML blocks by default. You can then opt into Markdown processing via markdown="1"
. More info on this on Kramdown's documentation. Hat tip to @marksteve.