-
-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy patheleventy.config.ts
47 lines (37 loc) · 1.27 KB
/
eleventy.config.ts
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
import EleventyImage from '@11ty/eleventy-img';
import constants from './src/common/constants';
import {
imageIconShortcode,
imageThumbnailShortcode,
minifyCssFilter,
minifyHtmlTransform,
relativeUrlFilter,
supportTypeScriptTemplate,
} from './src/common/eleventy-utils';
EleventyImage.concurrency = constants.eleventyFetchConcurrency;
// biome-ignore lint/suspicious/noExplicitAny: This is intentional
module.exports = (eleventyConfig: any) => {
// static assets
eleventyConfig.addPassthroughCopy('src/site/images');
eleventyConfig.addPassthroughCopy('src/site/feeds');
// images
eleventyConfig.addNunjucksAsyncShortcode('imageThumbnail', imageThumbnailShortcode);
eleventyConfig.addNunjucksAsyncShortcode('imageIcon', imageIconShortcode);
// minify html
eleventyConfig.addTransform('minify html', minifyHtmlTransform);
// relative path
eleventyConfig.addFilter('relativeUrl', relativeUrlFilter);
// minify css
eleventyConfig.addFilter('minifyCss', minifyCssFilter);
// TypeScript
supportTypeScriptTemplate(eleventyConfig);
// TODO: _data も TypeScript 対応したい
// @see https://github.com/11ty/eleventy/discussions/1835
return {
htmlTemplateEngine: 'njk',
dir: {
input: 'src/site',
output: 'public',
},
};
};