forked from qbittorrent/qBittorrent-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
32 lines (27 loc) · 992 Bytes
/
.eleventy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const MarkdownItAnchor = require("markdown-it-anchor");
module.exports = (eleventyConfig) => {
const sourceDir = "src";
// Copy folders as-is
eleventyConfig.addPassthroughCopy(`${sourceDir}/.well-known`);
eleventyConfig.addPassthroughCopy(`${sourceDir}/css`);
eleventyConfig.addPassthroughCopy(`${sourceDir}/img`);
eleventyConfig.addPassthroughCopy(`${sourceDir}/scripts`);
// Copy files as-is
eleventyConfig.addPassthroughCopy(`${sourceDir}/.htaccess`);
eleventyConfig.addPassthroughCopy(`${sourceDir}/favicon.ico`);
eleventyConfig.addPassthroughCopy(`${sourceDir}/favicon.svg`);
// Ignored files
eleventyConfig.ignores.add(`${sourceDir}/old_news.md`);
eleventyConfig.amendLibrary("md", (mdLib) => {
// https://github.com/valeriangalliat/markdown-it-anchor#usage
const options = {
permalink: MarkdownItAnchor.permalink.headerLink()
};
mdLib.use(MarkdownItAnchor, options);
});
return {
dir: {
input: sourceDir
}
};
};