-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eleventy.config.js
89 lines (76 loc) · 2.58 KB
/
eleventy.config.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import 'dotenv/config.js';
import { EleventyHtmlBasePlugin } from '@11ty/eleventy';
import pluginReadingTime from 'eleventy-plugin-reading-time';
import pluginRss from '@11ty/eleventy-plugin-rss';
import pluginIcons from 'eleventy-plugin-icons';
import { optimize as svgo } from 'svgo';
import { sitePluginShortcodes } from './src/_11ty/shortcodes/index.js';
import { sitePluginFilters } from './src/_11ty/filters.js';
import { sitePluginMarkdown } from './src/_11ty/plugins/markdown.js';
import { sitePluginShiki } from './src/_11ty/plugins/shiki.js';
import { sitePluginHtmlmin } from './src/_11ty/plugins/htmlmin.js';
const configFn = (eleventyConfig) => {
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
eleventyConfig.addPlugin(pluginReadingTime);
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(pluginIcons, {
mode: 'inline',
sources: [
{ name: 'lucide', path: './node_modules/lucide-static/icons' },
{ name: 'simpleicon', path: './node_modules/simple-icons/icons' },
{ name: 'custom', path: './src/_icons' },
],
icon: {
class: () => '',
transform: async (svg) => {
const optimized = svgo(svg, {
multipass: true,
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
}).data;
return optimized;
},
attributesBySource: {
simpleicon: {
fill: 'currentColor',
stroke: 'none',
},
},
},
});
// eleventyConfig.setQuietMode(true);
// eleventyConfig.addPlugin(pluginDirectoryOutput);
eleventyConfig.addPlugin(sitePluginShortcodes);
eleventyConfig.addPlugin(sitePluginFilters);
eleventyConfig.addPlugin(sitePluginMarkdown);
eleventyConfig.addPlugin(sitePluginShiki);
eleventyConfig.addPlugin(sitePluginHtmlmin);
eleventyConfig.addPassthroughCopy({
'./src/assets/manifest.webmanifest': 'manifest.webmanifest',
'./src/assets/icons/favicon.ico': 'favicon.ico',
'./src/assets/icons': 'icons',
'./src/assets/fonts': 'fonts',
'./src/images': 'images',
});
eleventyConfig.addWatchTarget('tailwind.config.js');
eleventyConfig.addWatchTarget('src/_icons/*');
eleventyConfig.addWatchTarget('src/assets/**/*.{js,ts,css}');
eleventyConfig.addWatchTarget('.env');
eleventyConfig.setServerOptions({ domDiff: false });
};
export const config = {
dir: {
input: 'src',
layouts: '_layouts',
},
markdownTemplateEngine: 'njk',
};
export default configFn;