-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
38 lines (33 loc) · 1.06 KB
/
.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
33
34
35
36
37
38
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const markdownIt = require("markdown-it");
const markdownItMulticol = require("markdown-it-multicolumn").default;
const markdownItClass = require('@toycode/markdown-it-class');
const markdownItAttrs = require('markdown-it-attrs');
module.exports = function(eleventyConfig) {
// Output directory: _site
// // Copy `img/` to `_site/img`
eleventyConfig.addPassthroughCopy("src/img");
eleventyConfig.addPassthroughCopy("src/css");
eleventyConfig.addPassthroughCopy("src/js");
let options = {
html: true
};
let mapping = {
table: 'table table-striped',
img: 'markImg'
}
let markdownLib = markdownIt(options)
.use(markdownItMulticol)
.use(markdownItClass, mapping)
.use(markdownItAttrs);
// markdownLib.renderer.rules.table_open = function(tokens, idx) {
// return '<table class="table table-striped">';
// };
eleventyConfig.setLibrary("md", markdownLib);
eleventyConfig.addPlugin(syntaxHighlight);
return {
dir: {
input: "src"
}
}
};