Skip to content

Commit 19eb37c

Browse files
committed
Switch from peer deps to 11ty.compatibility
1 parent 74a6f91 commit 19eb37c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.eleventy.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
const pkg = require("./package.json");
12
const EleventyNavigation = require("./eleventy-navigation");
23

34
// export the configuration function for plugin
45
module.exports = function(eleventyConfig) {
6+
try {
7+
eleventyConfig.versionCheck(pkg["11ty"].compatibility);
8+
} catch(e) {
9+
console.log( `WARN: Eleventy Plugin (${pkg.name}) Compatibility: ${e.message}` );
10+
}
11+
512
eleventyConfig.addFilter("eleventyNavigation", EleventyNavigation.findNavigationEntries);
613
eleventyConfig.addFilter("eleventyNavigationBreadcrumb", EleventyNavigation.findBreadcrumbEntries);
714
eleventyConfig.addFilter("eleventyNavigationToHtml", function(pages, options) {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"url": "https://zachleat.com/"
3333
},
3434
"license": "MIT",
35-
"peerDependencies": {
36-
"@11ty/eleventy": ">=0.7.0"
35+
"11ty": {
36+
"compatibility": ">=0.7 || >=1.0.0-canary"
3737
},
3838
"devDependencies": {
3939
"ava": "^3.15.0"

0 commit comments

Comments
 (0)