summary refs log tree commit diff
path: root/eleventy.config.js
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2023-08-17 12:21:14 -0500
committerStarfall <us@starfall.systems>2023-08-17 12:24:10 -0500
commita369e660f5b387f2e68288518ac0130945b6affd (patch)
tree94f58b7b969efe95ab1da176a9f46ef69b2cf49a /eleventy.config.js
parent246d9537a7edf8d93f75decd83872374813449df (diff)
add excerpts to blog posts
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: {