-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.eleventy.js
35 lines (31 loc) · 1.09 KB
/
.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
32
33
34
35
// @ts-check
const eleventyAsciidoc = require("./lib/eleventy-asciidoc.js");
const pkg = require("./package.json");
/** @typedef {import('./lib/eleventy-asciidoc.js').ProcessorOptions} ProcessorOptions} */
module.exports = {
/**
* Plugin config function
*
* @param {object} eleventyConfig The eleventy configuration object
* @param {ProcessorOptions} converterOptions Options for Asciidoctor.converter()
*/
configFunction(eleventyConfig, converterOptions) {
try {
eleventyConfig.versionCheck(pkg["11ty"].compatibility);
} catch (e) {
console.log(
`WARN: Eleventy Plugin (${pkg.name}) Compatibility: ${e.message}`,
);
}
if (converterOptions?.extension_registry !== undefined) {
console.log(
`WARN: 'extension_registry' doesn't work well with Asciidoctor.js v3+. Use 'configure_extension_registry'.`,
);
}
eleventyConfig.addTemplateFormats(["adoc", "asciidoc", "ad"]);
eleventyConfig.addExtension(
["adoc", "asciidoc", "ad"],
eleventyAsciidoc(converterOptions),
);
},
};