-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eleventy.js
51 lines (41 loc) · 1.67 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
const pluginBookshop = require("@bookshop/eleventy-bookshop");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const MarkdownIt = require("markdown-it"),
md = new MarkdownIt({
html: true,
});
/* 11ty config imports */
const image_shortcode = require('./_11ty_config/image_shortcode')
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/assets/images")
eleventyConfig.addPassthroughCopy("src/assets/videos")
eleventyConfig.addPassthroughCopy("src/assets/documents")
eleventyConfig.addPassthroughCopy("node_modules/@fortawesome/fontawesome-free/css/all.min.css")
eleventyConfig.addPassthroughCopy("node_modules/@fortawesome/fontawesome-free/webfonts")
eleventyConfig.addWatchTarget('tailwind.config.js');
eleventyConfig.addWatchTarget('src/assets/styles/**/*.{css,scss}');
eleventyConfig.addWatchTarget("component-library/");
eleventyConfig.addPlugin(pluginBookshop({
bookshopLocations: ["component-library"],
pathPrefix: ''
}));
eleventyConfig.addPlugin(pluginRss);
// Custom Shortcodes
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
eleventyConfig.addShortcode("image", image_shortcode);
eleventyConfig.addPairedLiquidShortcode("tint", function(content, tint_color) {
return `<span style="color: ${tint_color}">${ content }</span>`
});
// Custom Filters
eleventyConfig.addFilter("markdownify", (markdown) => md.render(markdown));
// Custom Collection
eleventyConfig.addCollection("posts", function (collectionApi) {
return collectionApi.getFilteredByGlob("src/pages/blog/**/*.md");
});
return {
dir: {
input: "src",
output: "_site"
}
}
};