2019-05-20 20:41:39 +02:00
|
|
|
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
|
|
|
|
const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");
|
2020-08-21 23:27:47 +02:00
|
|
|
const navigationPlugin = require("@11ty/eleventy-navigation");
|
2019-05-20 20:41:39 +02:00
|
|
|
|
|
|
|
module.exports = function(eleventyConfig) {
|
|
|
|
eleventyConfig.addPlugin(pluginSyntaxHighlight);
|
|
|
|
eleventyConfig.addPlugin(inclusiveLangPlugin);
|
2020-08-21 23:27:47 +02:00
|
|
|
eleventyConfig.addPlugin(navigationPlugin);
|
2019-05-20 20:41:39 +02:00
|
|
|
|
|
|
|
let markdownIt = require("markdown-it");
|
|
|
|
let markdownItAnchor = require("markdown-it-anchor");
|
|
|
|
let markdownItReplaceLink = require("markdown-it-replace-link");
|
|
|
|
|
|
|
|
let markdownItOptions = {
|
|
|
|
html: true,
|
|
|
|
breaks: false,
|
|
|
|
linkify: true,
|
|
|
|
replaceLink: function (link, env) {
|
2019-10-14 22:13:41 +02:00
|
|
|
if (process.env.NODE_ENV == "production") {
|
|
|
|
return link;
|
|
|
|
}
|
|
|
|
return link.replace('https://torsion.org/borgmatic/', 'http://localhost:8080/');
|
2019-05-20 20:41:39 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
let markdownItAnchorOptions = {
|
|
|
|
permalink: true,
|
|
|
|
permalinkClass: "direct-link"
|
|
|
|
};
|
|
|
|
|
|
|
|
eleventyConfig.setLibrary(
|
|
|
|
"md",
|
|
|
|
markdownIt(markdownItOptions)
|
|
|
|
.use(markdownItAnchor, markdownItAnchorOptions)
|
|
|
|
.use(markdownItReplaceLink)
|
|
|
|
);
|
|
|
|
|
2019-11-14 18:34:53 +01:00
|
|
|
eleventyConfig.addPassthroughCopy({"docs/static": "static"});
|
|
|
|
|
2019-05-20 20:41:39 +02:00
|
|
|
return {
|
|
|
|
templateFormats: [
|
|
|
|
"md",
|
|
|
|
"txt"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|