-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
51 lines (40 loc) · 1.4 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
39
40
41
42
43
44
45
46
47
48
49
50
51
require('dotenv').config();
module.exports = function (eleventyConfig) {
eleventyConfig.addGlobalData("env", process.env);
eleventyConfig.addPassthroughCopy("./src/assets");
eleventyConfig.addPassthroughCopy("./src/css");
eleventyConfig.addPassthroughCopy("./src/js");
eleventyConfig.addWatchTarget("./src/css/");
eleventyConfig.addWatchTarget("./src/js/");
eleventyConfig.addShortcode('year', () => {
return `${new Date().getFullYear()}`;
});
eleventyConfig.addShortcode('convertTime', (UTCDate) => {
const options = {
year: 'numeric',
month: 'long',
day: 'numeric',
}
return `${new Date(UTCDate).toLocaleDateString(undefined,options)}`;
});
eleventyConfig.addPassthroughCopy({
"./node_modules/medium-zoom/dist/medium-zoom.min.js": "./js/medium-zoom.min.js"
});
const markdownIt = require('markdown-it');
const markdownItAttrs = require('markdown-it-attrs');
const markdownItOptions = {
html: true,
breaks: false,
linkify: true
};
const markdownLib = markdownIt(markdownItOptions).use(markdownItAttrs);
eleventyConfig.setLibrary('md', markdownLib);
const eleventySass = require("eleventy-sass");
eleventyConfig.addPlugin(eleventySass);
return {
dir: {
input: "src",
output: "public"
},
};
};