-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
.eleventy.js
31 lines (28 loc) · 902 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
'use strict';
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const markdownIt = require('markdown-it');
const markdownItAnchor = require('markdown-it-anchor');
function slugify(s) {
return encodeURIComponent(
String(s).trim().toLowerCase()
.replace(/[\(\)]/g, '')
.replace(/\s+/g, '-')
);
}
module.exports = function(eleventyConfig) {
const src = process.env.SLATEDIR || 'source';
eleventyConfig.addPassthroughCopy(src+"/slate/css/*.css");
eleventyConfig.addPassthroughCopy(src+"/slate/js");
eleventyConfig.addPassthroughCopy(src+"/slate/img");
eleventyConfig.addPassthroughCopy(src+"/slate/fonts");
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.setLibrary("md",
markdownIt({
html: true,
linkify: true,
typographer: true
}).use(markdownItAnchor, {
slugify: slugify
})
);
};