forked from darthmall/11ty.webc.fun
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheleventy.config.js
More file actions
40 lines (34 loc) · 1.15 KB
/
eleventy.config.js
File metadata and controls
40 lines (34 loc) · 1.15 KB
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
const pluginRSS = require("@11ty/eleventy-plugin-rss");
const pluginWebC = require("@11ty/eleventy-plugin-webc");
const postcss = require("postcss");
const atImport = require("postcss-import");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(pluginRSS);
eleventyConfig.addPlugin(pluginWebC, {
components: "src/components/**/*.webc",
});
eleventyConfig.addTemplateFormats("css");
eleventyConfig.addExtension("css", {
outputFileExtension: "css",
compile: async function (inputContent) {
const result = await postcss([atImport]).process(inputContent);
return async () => result.css;
},
});
eleventyConfig.addCollection("feed", function (collectionApi) {
return collectionApi.getFilteredByGlob("src/pages/recipes/**/*");
});
// FIXME: The passthrough behavior in the dev server doesn't seem to be
// working, so for now we'll go back to the copy behavior.
eleventyConfig.setServerPassthroughCopyBehavior("copy");
eleventyConfig.addPassthroughCopy({ "public": "." });
return {
dir: {
input: "src/pages",
includes: "../components",
layouts: "../layouts",
data: "../data",
},
markdownTemplateEngine: false
};
};