-
Notifications
You must be signed in to change notification settings - Fork 3
/
eleventy.config.cjs
44 lines (38 loc) · 1.32 KB
/
eleventy.config.cjs
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
//@ts-check
const defaultConfig = require("@11ty/eleventy/src/defaultConfig");
const domain = "https://template.webstandards.ca.gov";
module.exports = function (
/** @type {import("@11ty/eleventy").UserConfig} **/ eleventyConfig
) {
// Copy `src/css/` to `_site/css`, `src/images/` to `_site/images`
// Copy all static files that should appear in the website root
// Copy state tempate code files from NPM
eleventyConfig.addPassthroughCopy({
"src/images": "images",
"src/css": "css",
"src/root": "/",
"node_modules/@cagovweb/state-template/dist": "state-template"
});
//Sorted list of all the samples
eleventyConfig.addFilter(
"canonical",
(/** @type {{url:string}} */ page) => domain + page.url
);
//Start with default config, easier to configure 11ty later
const config = defaultConfig(eleventyConfig);
// allow nunjucks templating in .html files
config.htmlTemplateEngine = "njk";
config.markdownTemplateEngine = "njk";
config.templateFormats = ["html", "njk", "11ty.js", "md"];
config.dir = {
// site content pages
input: "pages",
data: "../src/_data",
// site structure pages (path is realtive to input directory)
includes: "../src/_includes",
layouts: "../src/_includes/layouts",
// site final outpuut directory
output: "_site"
};
return config;
};