summary refs log tree commit diff
path: root/eleventy.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'eleventy.config.js')
-rw-r--r--eleventy.config.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/eleventy.config.js b/eleventy.config.js
index dd31cc3..07da99d 100644
--- a/eleventy.config.js
+++ b/eleventy.config.js
@@ -1,7 +1,12 @@
 const toml = require('@iarna/toml')
+const markdown = require("markdown-it")
 const eleventyNavigation = require('@11ty/eleventy-navigation')
 const eleventyRss = require('@11ty/eleventy-plugin-rss')
 
+const MD_OPTIONS = { 
+	html: true,
+};
+
 filter_local_date = function(date) {
 	// yyyy-MM-dd
 	return date.getFullYear() + '-'
@@ -15,7 +20,10 @@ filter_rfc3339_datetime = function(date) {
 	return date.toISOString().replace('T', ' ');
 }
 
+
 module.exports = function(eleventyConfig) {
+	eleventyConfig.setLibrary('md', markdown(MD_OPTIONS));
+
 	eleventyConfig.addPlugin(eleventyNavigation)
 	eleventyConfig.addPlugin(eleventyRss)
 
@@ -25,6 +33,9 @@ module.exports = function(eleventyConfig) {
 
 	eleventyConfig.addFilter('local_date', filter_local_date)
 	eleventyConfig.addFilter('rfc3339_datetime', filter_rfc3339_datetime)
+	eleventyConfig.addFilter('md', str => {
+		return markdown(MD_OPTIONS).render(str);
+	})
 
 	eleventyConfig.setFrontMatterParsingOptions({
 		engines: {