comprofix.com/.eleventy.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-08-07 00:57:36 +10:00
const blogTools = require("eleventy-plugin-blog-tools");
2022-08-07 02:18:36 +10:00
const markdownIt = require("markdown-it");
const markdownItAttrs = require("markdown-it-attrs");
2022-08-07 00:57:36 +10:00
module.exports = function(eleventyConfig) {
2022-08-07 02:18:36 +10:00
const mdOptions = {
html: true,
breaks: true,
linkify: true,
};
const markdownLib = markdownIt(mdOptions)
.use(markdownItAttrs)
.disable("code");
eleventyConfig.setLibrary("md", markdownLib);
2022-08-07 00:57:36 +10:00
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.addPassthroughCopy('./src/css');
eleventyConfig.addPassthroughCopy('./src/assets/');
eleventyConfig.addWatchTarget('./src/css');
eleventyConfig.addWatchTarget('./src/components');
eleventyConfig.setDataDeepMerge(true);
eleventyConfig.setTemplateFormats("html,njk,md");
eleventyConfig.addCollection('posts', function(collectionApi) {
return collectionApi.getFilteredByGlob('src/blog/posts/**/*.md')
});
eleventyConfig.addPlugin(blogTools);
return {
passthroughFileCopy: true,
dir: {
input: 'src',
includes: '_includes',
output: "_site"
}
};
}