generated from yamanoku/document-page-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
32 lines (31 loc) · 903 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 markdownIt = require("markdown-it");
const mila = require("markdown-it-link-attributes");
const markdownItFootnote = require('markdown-it-footnote');
const { loadDefaultJapaneseParser } = require("budoux");
const parser = loadDefaultJapaneseParser();
module.exports = (eleventyConfig) => {
const mdOptions = {
html: true
};
const milaOptions = {
attrs: {
target: "_blank",
}
};
const markdownLib = markdownIt(mdOptions).use(mila, milaOptions).use(markdownItFootnote);
eleventyConfig.addJavaScriptFunction("budoux", t => {
return parser.translateHTMLString(t);
});
const today = new Date();
eleventyConfig.addJavaScriptFunction("year", () => {
return today.getFullYear();
})
eleventyConfig.setLibrary("md", markdownLib);
eleventyConfig.addPassthroughCopy("images");
return {
dir: {
input: "pages",
output: "docs",
},
};
};