2023-10-19 22:31:19 -04:00
|
|
|
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
|
2024-07-07 16:29:27 -04:00
|
|
|
const markdownIt = require("markdown-it");
|
2024-07-08 01:17:58 -04:00
|
|
|
const markdownItFootnote = require("markdown-it-footnote");
|
|
|
|
const markdownItAnchor = require("markdown-it-anchor");
|
2023-10-19 01:33:51 -04:00
|
|
|
const { DateTime } = require("luxon");
|
|
|
|
|
2024-07-07 16:29:27 -04:00
|
|
|
const MARKDOWN_OPTIONS = {
|
|
|
|
html: true,
|
|
|
|
breaks: true,
|
|
|
|
linkify: true,
|
|
|
|
typographer: true,
|
|
|
|
};
|
|
|
|
|
2024-07-08 01:17:58 -04:00
|
|
|
const md = new markdownIt(MARKDOWN_OPTIONS)
|
|
|
|
.use(markdownItFootnote)
|
|
|
|
.use(markdownItAnchor);
|
2024-07-07 16:29:27 -04:00
|
|
|
|
2023-10-18 13:32:43 -04:00
|
|
|
module.exports = function (eleventyConfig) {
|
2024-07-07 16:29:27 -04:00
|
|
|
// Libraries
|
|
|
|
eleventyConfig.setLibrary("md", md);
|
|
|
|
|
|
|
|
// Plugins
|
2023-10-19 22:31:19 -04:00
|
|
|
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
|
|
|
|
2024-07-07 16:29:27 -04:00
|
|
|
// Filters
|
2024-07-08 01:17:58 -04:00
|
|
|
eleventyConfig.addFilter("formatDate", (dateObj, format) => {
|
|
|
|
return DateTime.fromJSDate(dateObj).toFormat(format);
|
2023-10-19 01:33:51 -04:00
|
|
|
});
|
|
|
|
|
2024-07-07 16:29:27 -04:00
|
|
|
// Passthrough copies
|
2024-06-24 02:33:28 -04:00
|
|
|
eleventyConfig.addPassthroughCopy({ "./src/res/css/**/*.css": "css" });
|
|
|
|
eleventyConfig.addPassthroughCopy({ "./src/res/font": "font" });
|
|
|
|
eleventyConfig.addPassthroughCopy({ "./src/res/img": "img" });
|
2024-07-07 16:29:27 -04:00
|
|
|
eleventyConfig.addPassthroughCopy({ "./src/res/*.txt": "." });
|
|
|
|
eleventyConfig.addWatchTarget("./src/res/css"); // Watch stylesheets
|
2023-10-18 13:32:43 -04:00
|
|
|
|
|
|
|
return {
|
|
|
|
dir: {
|
|
|
|
input: "src",
|
2024-06-24 02:33:28 -04:00
|
|
|
output: "_site",
|
2023-10-18 13:32:43 -04:00
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|