diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-12-18 21:18:16 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-12-18 21:18:16 -0800 |
| commit | ea31ae742a06966c9223b03a27a3c271263424a0 (patch) | |
| tree | 81d8e0ff6e583629557897b6dc7b84d3f15c80ca /eleventy.config.js | |
| parent | 0888840cf20de2187095daa154ec441240a12ef3 (diff) | |
| download | lizdotcoffee-ea31ae742a06966c9223b03a27a3c271263424a0.tar.gz lizdotcoffee-ea31ae742a06966c9223b03a27a3c271263424a0.zip | |
Init pt 2
Diffstat (limited to 'eleventy.config.js')
| -rw-r--r-- | eleventy.config.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/eleventy.config.js b/eleventy.config.js new file mode 100644 index 0000000..ddf1e3e --- /dev/null +++ b/eleventy.config.js @@ -0,0 +1,39 @@ +import pluginRss from "@11ty/eleventy-plugin-rss"; +import markdownIt from "markdown-it"; +import { outdent } from "outdent"; + +export default function(eleventyConfig) { + eleventyConfig.addPlugin(pluginRss); + + eleventyConfig.addPassthroughCopy("src/assets"); + + // Configure markdown-it + const md = markdownIt({ + html: true, + breaks: false, + linkify: true + }); + + eleventyConfig.setLibrary("md", md); + + // Add markdown shortcode + eleventyConfig.addPairedShortcode("markdown", (content) => { + return md.render(outdent`${content}`); + }); + + // Add posts collection + eleventyConfig.addCollection("posts", (collectionApi) => { + return collectionApi.getFilteredByGlob("src/posts/**/*.md"); + }); + + return { + dir: { + input: "src", + output: "_site", + includes: "_includes", + layouts: "_layouts" + }, + markdownTemplateEngine: "njk", + htmlTemplateEngine: "njk" + }; +} |
