-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
72 lines (47 loc) · 2.17 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const dotenv = require('dotenv');
dotenv.config({ path: './config/config.env' });
const markdownify = require("./lib/filters/markdownfilter")
const blocksToMD = require("./lib/shortcodes/portableTextToHTML")
const betterSlugs = require("./lib/filters/betterSlugs")
const videoEmbed = require("./lib/shortcodes/videoEmbed")
const videoID = require("./lib/shortcodes/videoID")
const themeCalculations = require("./lib/utils/themeCalculations")
const responsiveImage = require("./lib/shortcodes/images/responsiveImage")
const dateConverter = require("./lib/shortcodes/dateConverter")
const bundlePointer = require("./lib/shortcodes/bundlePointer")
const emailSplitter = require("./lib/shortcodes/emailSplitter")
module.exports = (eleventyConfig) => {
eleventyConfig.setQuietMode(true);
eleventyConfig.setWatchThrottleWaitTime(1000);
eleventyConfig.setDataDeepMerge(true);
eleventyConfig.addTransform("htmlmin", require("./lib/transforms/htmlmin"))
// debugger
eleventyConfig.addFilter("debugger", (...args) => {
console.log(...args)
debugger;
});
eleventyConfig.setLibrary("md", markdownify.markdownLib);
eleventyConfig.addFilter("markdownify", markdownify);
eleventyConfig.addFilter("slug", betterSlugs);
eleventyConfig.addNunjucksAsyncShortcode("portableTextToHTML", blocksToMD);
eleventyConfig.addFilter("emailSplitter", emailSplitter);
eleventyConfig.addShortcode("themeCalculations", themeCalculations);
eleventyConfig.addNunjucksAsyncShortcode("image", responsiveImage);
eleventyConfig.addNunjucksShortcode("dateConverter", dateConverter);
eleventyConfig.addNunjucksAsyncShortcode("videoEmbed", videoEmbed);
eleventyConfig.addShortcode("videoID", videoID);
eleventyConfig.addShortcode("bundlePointer", bundlePointer);
eleventyConfig.addPassthroughCopy({ "./src/_includes/assets/robots.txt": "robots.txt" });
eleventyConfig.addPassthroughCopy({ "public": "hosting" });
eleventyConfig.addWatchTarget("./src/style/**/*"); // doesn't work with eleventy config not at root
return {
dir: {
input: "src",
output: "www"
},
// pathPrefix: "/subfolder/",
templateFormats: ['md', 'njk', 'html'],
dataTemplateEngine: 'njk',
markdownTemplateEngine: 'njk'
};
};