Skip to content

Commit

Permalink
feat(11ty): check compat when initialising
Browse files Browse the repository at this point in the history
  • Loading branch information
ovlb committed Sep 22, 2022
1 parent 2c6a6b5 commit 3d8d7b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// eslint-disable-next-line import/no-unassigned-import
require("array-flat-polyfill");

const pkg = require("./package.json");
const sitemap = require("./src/sitemap");

/**
Expand All @@ -13,6 +14,14 @@ const sitemap = require("./src/sitemap");
* @param {object} options Plugin user options.
*/
module.exports = function eleventyPluginSitemap(eleventyConfig, options) {
try {
eleventyConfig.versionCheck(pkg["11ty"].compatibility);
} catch (e) {
console.log(
`WARN: Eleventy Plugin (${pkg.name}) Compatibility: ${e.message}`
);
}

const finalOptions = options || {};

function getSitemap(items) {
Expand Down

0 comments on commit 3d8d7b8

Please sign in to comment.