Anders Grendstadbakk

Eleventy tip: Markdown template engine

You can use helpers, filters and template logic in your markdown files. And by default the template language for markdown files is liquid. This can lead to interesting results when you use a different template language that looks the same.

To fix this and ensure correct results you can define which template engine should be used for markdown files like this (in .eleventy.js):

module.exports = function(eleventyConfig) {
return {
htmlTemplateEngine: 'hbs', // Engine for html files.
markdownTemplateEngine: 'hbs' // Engine for markdown files.
};
};