forked from fluid-project/eleventy-plugin-fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eleventy.config.js
52 lines (44 loc) · 1.43 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
/*
Copyright the eleventy-plugin-fluid copyright holders.
See the AUTHORS.md file at the top-level directory of this distribution and at
https://github.com/fluid-project/eleventy-plugin-fluid/raw/main/AUTHORS.md.
Licensed under the New BSD license. You may not use this file except in compliance with this License.
You may obtain a copy of the New BSD License at
https://github.com/fluid-project/eleventy-plugin-fluid/raw/main/LICENSE.md.
*/
"use strict";
const fluidPlugin = require("./index.js");
const slugify = require("@sindresorhus/slugify");
const inputPath = "fixtures";
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(fluidPlugin, {
markdown: {
plugins: [
["markdown-it-anchor", { slugify: s => slugify(s) }]
]
},
sass: {
enabled: true
},
supportedLanguages: {
de: {
slug: "de",
uioSlug: "de",
dir: "ltr",
name: "Deutsch"
}
}
});
eleventyConfig.addPassthroughCopy(`${inputPath}/assets/images`, "/assets/");
["en", "fr"].forEach(lang => {
eleventyConfig.addCollection(`posts_${lang}`, collection => {
return collection.getFilteredByGlob(`./fixtures/posts/${lang}/*.md`);
});
});
return {
dir: {
input: inputPath
},
passthroughFileCopy: true
};
};