-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eleventy.js
27 lines (27 loc) · 1022 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
const MarkdownIt = require("markdown-it");
const htmlmin = require("html-minifier");
const markdownIt = new MarkdownIt({
html: true,
linkify: true,
typographer: true
});
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/images");
eleventyConfig.addPassthroughCopy("src/*.css");
eleventyConfig.addPassthroughCopy({"src/_data/(rules|definitions).json": "data"});
eleventyConfig.addPassthroughCopy({"src/_data/facts/*.json": "data/facts"});
eleventyConfig.addNunjucksFilter("markdown", function (value) {
return markdownIt.render(value);
});
eleventyConfig.addTransform("htmlmin", function (content, outputPath) {
if (outputPath && outputPath.endsWith(".html")) {
return htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
}
return content;
});
return {pathPrefix: '/regles-ultimate-fr/'}
};