2019-05-20 20:41:39 +02:00
|
|
|
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
|
2023-03-23 10:15:23 +01:00
|
|
|
const codeClipboard = require("eleventy-plugin-code-clipboard");
|
2019-05-20 20:41:39 +02:00
|
|
|
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);
|
2023-03-23 10:15:23 +01:00
|
|
|
eleventyConfig.addPlugin(codeClipboard);
|
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 = {
|
2022-08-22 06:48:07 +02:00
|
|
|
permalink: markdownItAnchor.permalink.headerLink()
|
2019-05-20 20:41:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
eleventyConfig.setLibrary(
|
|
|
|
"md",
|
|
|
|
markdownIt(markdownItOptions)
|
|
|
|
.use(markdownItAnchor, markdownItAnchorOptions)
|
|
|
|
.use(markdownItReplaceLink)
|
2023-03-23 10:15:23 +01:00
|
|
|
.use(codeClipboard.markdownItCopyButton)
|
2019-05-20 20:41:39 +02:00
|
|
|
);
|
|
|
|
|
2019-11-14 18:34:53 +01:00
|
|
|
eleventyConfig.addPassthroughCopy({"docs/static": "static"});
|
|
|
|
|
2022-01-09 23:21:27 +01:00
|
|
|
eleventyConfig.setLiquidOptions({dynamicPartials: false});
|
|
|
|
|
2019-05-20 20:41:39 +02:00
|
|
|
return {
|
|
|
|
templateFormats: [
|
|
|
|
"md",
|
|
|
|
"txt"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|