Eleventy-Template/.eleventy.js

26 lines
729 B
JavaScript
Raw Normal View History

2024-01-31 16:33:44 +00:00
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
const markdownIt = require('markdown-it')
const markdownItAnchor = require('markdown-it-anchor')
module.exports = function(eleventyConfig) {
// Copy these static files to _site folder
eleventyConfig.addPassthroughCopy('src/assets')
eleventyConfig.addPassthroughCopy('src/manifest.json')
const md = markdownIt({ html: true, linkify: true })
md.use(markdownItAnchor, {
level: [1, 2],
permalink: markdownItAnchor.permalink.headerLink({
safariReaderFix: true,
class: 'header-anchor',
})
})
eleventyConfig.setLibrary('md', md)
return {
markdownTemplateEngine: 'liquid',
dir: {
input: 'src'
}
}
}