46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
|
|
import markdownIt from "markdown-it";
|
|
import markdownItFootnote from "markdown-it-footnote";
|
|
import markdownItAnchor from "markdown-it-anchor";
|
|
import { DateTime } from "luxon";
|
|
|
|
export default function (eleventyConfig) {
|
|
const MARKDOWN_OPTIONS = {
|
|
html: true,
|
|
breaks: true,
|
|
linkify: true,
|
|
typographer: true,
|
|
};
|
|
|
|
let md = markdownIt(MARKDOWN_OPTIONS)
|
|
.use(markdownItFootnote)
|
|
.use(markdownItAnchor);
|
|
|
|
// Libraries
|
|
eleventyConfig.setLibrary("md", md);
|
|
|
|
// Plugins
|
|
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
|
|
|
// Filters
|
|
eleventyConfig.addFilter("formatDate", (dateObj) => {
|
|
return DateTime.fromJSDate(dateObj).toFormat('dd LLL yyyy, HH:mm ZZZZ');
|
|
});
|
|
|
|
// Passthrough copies
|
|
["src/assets"].forEach((path) => {
|
|
eleventyConfig.addPassthroughCopy(path);
|
|
});
|
|
|
|
eleventyConfig.addWatchTarget("./src/assets/css");
|
|
|
|
return {
|
|
dir: {
|
|
input: "src",
|
|
output: "public",
|
|
includes: "_includes",
|
|
layouts: "_layouts",
|
|
},
|
|
};
|
|
}
|