forked from 11ty/eleventy-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
26 lines (23 loc) · 1.06 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
const pkg = require("./package.json");
const EleventyNavigation = require("./eleventy-navigation");
// export the configuration function for plugin
module.exports = function(eleventyConfig) {
try {
eleventyConfig.versionCheck(pkg["11ty"].compatibility);
} catch(e) {
console.log( `WARN: Eleventy Plugin (${pkg.name}) Compatibility: ${e.message}` );
}
eleventyConfig.addFilter("eleventyNavigation", EleventyNavigation.findNavigationEntries);
eleventyConfig.addFilter("eleventyNavigationBreadcrumb", EleventyNavigation.findBreadcrumbEntries);
eleventyConfig.addFilter("eleventyNavigationToHtml", function(pages, options) {
return EleventyNavigation.toHtml.call(eleventyConfig, pages, options);
});
eleventyConfig.addFilter("eleventyNavigationToMarkdown", function(pages, options) {
return EleventyNavigation.toMarkdown.call(eleventyConfig, pages, options);
});
};
module.exports.navigation = {
find: EleventyNavigation.findNavigationEntries,
findBreadcrumbs: EleventyNavigation.findBreadcrumbEntries,
getDependencyGraph: EleventyNavigation.getDependencyGraph,
};