@chrisburnell/eleventy-cache-webmentions 1.0.0-beta.2 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eleventy-cache-webmentions.js +16 -12
- package/package.json +1 -1
|
@@ -72,6 +72,22 @@ const defaults = {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
const fetchWebmentions = async (options) => {
|
|
75
|
+
if (!options.domain) {
|
|
76
|
+
throw new Error("domain is a required field when adding the plugin to your eleventyConfig using addPlugin. See https://chrisburnell.com/eleventy-cache-webmentions/#installation for more information.")
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!options.feed) {
|
|
80
|
+
throw new Error("feed is a required field when adding the plugin to your eleventyConfig using addPlugin. See https://chrisburnell.com/eleventy-cache-webmentions/#installation for more information.")
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (!options.key) {
|
|
84
|
+
throw new Error("key is a required field when adding the plugin to your eleventyConfig using addPlugin. See https://chrisburnell.com/eleventy-cache-webmentions/#installation for more information.")
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!options.uniqueKey) {
|
|
88
|
+
throw new Error("uniqueKey is a required field when adding the plugin to your eleventyConfig using addPlugin. See https://chrisburnell.com/eleventy-cache-webmentions/#installation for more information.")
|
|
89
|
+
}
|
|
90
|
+
|
|
75
91
|
let asset = new AssetCache(options.uniqueKey)
|
|
76
92
|
asset.ensureDir()
|
|
77
93
|
|
|
@@ -184,18 +200,6 @@ const getWebmentionsFilter = async (options, url, allowedTypes, callback) => {
|
|
|
184
200
|
module.exports = (eleventyConfig, options = {}) => {
|
|
185
201
|
options = Object.assign(defaults, options)
|
|
186
202
|
|
|
187
|
-
if (!options.domain) {
|
|
188
|
-
throw new Error("domain is a required field when adding the plugin to your eleventyConfig using addPlugin. See https://chrisburnell.com/eleventy-cache-webmentions/#installation for more information.")
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (!options.feed) {
|
|
192
|
-
throw new Error("feed is a required field when adding the plugin to your eleventyConfig using addPlugin. See https://chrisburnell.com/eleventy-cache-webmentions/#installation for more information.")
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (!options.key) {
|
|
196
|
-
throw new Error("key is a required field when adding the plugin to your eleventyConfig using addPlugin. See https://chrisburnell.com/eleventy-cache-webmentions/#installation for more information.")
|
|
197
|
-
}
|
|
198
|
-
|
|
199
203
|
if (eleventyConfig) {
|
|
200
204
|
// Global Data
|
|
201
205
|
eleventyConfig.addGlobalData("webmentions", filteredWebmentions(options))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrisburnell/eleventy-cache-webmentions",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"description": "Fetch and cache webmentions using eleventy-fetch.",
|
|
5
5
|
"main": "eleventy-cache-webmentions.js",
|
|
6
6
|
"author": "Chris Burnell <me@chrisburnell.com>",
|