eleventy-plugin-cloudcannon
Advanced tools
Comparing version 0.0.12 to 0.0.13
const pkginfo = require('pkginfo')(module, 'version'); | ||
const version = module.exports.version; | ||
const time = new Date().toISOString(); | ||
@@ -18,2 +20,3 @@ // defaultConfig should match the return value from https://www.11ty.dev/docs/config/ | ||
eleventyConfig.addNunjucksShortcode('ccTime', () => time); | ||
eleventyConfig.addNunjucksShortcode('ccPath', (key) => (config.dir[key] ?? '').replace(/^\.\/?/, '')); | ||
@@ -20,0 +23,0 @@ eleventyConfig.addNunjucksShortcode('ccConfig', (key) => JSON.stringify(config[key] ?? '')); |
@@ -5,3 +5,3 @@ const pluginCloudCannon = require('eleventy-plugin-cloudcannon'); | ||
// Adds the cloudcannon plugin after running the renamed default config file | ||
module.exports = function (eleventyConfig) { | ||
module.exports = function (eleventyConfig, ...args) { | ||
let defaultConfig; | ||
@@ -15,5 +15,5 @@ | ||
const config = defaultConfig?.apply(this, arguments); | ||
const config = defaultConfig?.apply?.(this, [eleventyConfig, ...args]) ?? {}; | ||
eleventyConfig.addPlugin(pluginCloudCannon, eleventyConfig.cloudcannonOptions ?? config); | ||
return config; | ||
}; |
{ | ||
"name": "eleventy-plugin-cloudcannon", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Eleventy plugin to create CloudCannon editor details", | ||
@@ -5,0 +5,0 @@ "main": ".eleventy.js", |
@@ -18,3 +18,3 @@ # Eleventy Plugin CloudCannon | ||
``` | ||
```sh | ||
rm -rf cloudcannon | ||
@@ -27,3 +27,3 @@ cp -R node_modules/eleventy-plugin-cloudcannon/cloudcannon . | ||
``` | ||
```javascript | ||
module.exports = function (eleventyConfig) { | ||
@@ -49,3 +49,3 @@ const config = { | ||
``` | ||
```sh | ||
npm install eleventy-plugin-cloudcannon --save | ||
@@ -56,3 +56,3 @@ ``` | ||
``` | ||
```javascript | ||
const pluginCloudCannon = require('eleventy-plugin-cloudcannon'); | ||
@@ -67,3 +67,3 @@ | ||
``` | ||
```javascript | ||
const pluginCloudCannon = require('eleventy-plugin-cloudcannon'); | ||
@@ -112,3 +112,3 @@ | ||
``` | ||
```json | ||
{ | ||
@@ -115,0 +115,0 @@ "timezone": "", |
Sorry, the diff of this file is not supported yet
14637
154