-
Notifications
You must be signed in to change notification settings - Fork 165
/
.eleventy.js
31 lines (27 loc) · 946 Bytes
/
.eleventy.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
// @ts-check
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const syntaxhighlightPlugin = require("@11ty/eleventy-plugin-syntaxhighlight");
const cadlPrismDefinition = require("./cadl-prism-lang.js");
const prNumber = process.env["SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"];
module.exports = (eleventyConfig) => {
eleventyConfig.addPassthroughCopy("css");
eleventyConfig.addPassthroughCopy({
"node_modules/prism-themes/themes/prism-one-light.css": "css/themes/prism-one-light.css",
});
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(syntaxhighlightPlugin, {
init: ({ Prism }) => {
Prism.languages.cadl = cadlPrismDefinition;
},
});
return {
markdownTemplateEngine: "njk",
dataTemplateEngine: "njk",
htmlTemplateEngine: "njk",
dir: {
input: "src",
output: "dist",
},
pathPrefix: prNumber ? `/prs/${prNumber}/` : "/",
};
};