@chrisburnell/eleventy-cache-webmentions 2.1.3 → 2.1.4

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.
@@ -72,6 +72,15 @@ const getContent = (webmention) => {
72
72
  };
73
73
 
74
74
  const getSource = (webmention) => {
75
+ return (
76
+ webmention["wm-source"] ||
77
+ webmention["source"] ||
78
+ webmention?.["data"]?.["url"] ||
79
+ webmention["url"]
80
+ );
81
+ };
82
+
83
+ const getURL = (webmention) => {
75
84
  return (
76
85
  webmention?.["data"]?.["url"] ||
77
86
  webmention["url"] ||
@@ -399,6 +408,7 @@ const eleventyCacheWebmentions = (eleventyConfig, options = {}) => {
399
408
  eleventyConfig.addLiquidFilter("getWebmentionReceived", getReceived);
400
409
  eleventyConfig.addLiquidFilter("getWebmentionContent", getContent);
401
410
  eleventyConfig.addLiquidFilter("getWebmentionSource", getSource);
411
+ eleventyConfig.addLiquidFilter("getWebmentionURL", getURL);
402
412
  eleventyConfig.addLiquidFilter("getWebmentionTarget", getTarget);
403
413
  eleventyConfig.addLiquidFilter("getWebmentionType", getType);
404
414
 
@@ -409,6 +419,7 @@ const eleventyCacheWebmentions = (eleventyConfig, options = {}) => {
409
419
  eleventyConfig.addNunjucksFilter("getWebmentionReceived", getReceived);
410
420
  eleventyConfig.addNunjucksFilter("getWebmentionContent", getContent);
411
421
  eleventyConfig.addNunjucksFilter("getWebmentionSource", getSource);
422
+ eleventyConfig.addNunjucksFilter("getWebmentionURL", getURL);
412
423
  eleventyConfig.addNunjucksFilter("getWebmentionTarget", getTarget);
413
424
  eleventyConfig.addNunjucksFilter("getWebmentionType", getType);
414
425
  };
@@ -431,6 +442,8 @@ module.exports.getContent = getContent;
431
442
  module.exports.getWebmentionContent = getContent;
432
443
  module.exports.getSource = getSource;
433
444
  module.exports.getWebmentionSource = getSource;
445
+ module.exports.getURL = getURL;
446
+ module.exports.getWebmentionURL = getURL;
434
447
  module.exports.getTarget = getTarget;
435
448
  module.exports.getWebmentionTarget = getTarget;
436
449
  module.exports.getType = getType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrisburnell/eleventy-cache-webmentions",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Cache webmentions using eleventy-fetch and make them available to use in collections, layouts, pages, etc. in Eleventy.",
5
5
  "license": "MIT",
6
6
  "repository": {