Skip to content

Commit

Permalink
let's throw out a data file of all WMs too
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburnell committed Dec 8, 2021
1 parent 42332fb commit 098c546
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions eleventy-cache-webmentions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const sanitizeHTML = require("sanitize-html")
const uniqBy = require("lodash/uniqBy")
const { AssetCache } = require("@11ty/eleventy-cache-assets")

// Load .env variables with dotenv
require("dotenv").config()
const TOKEN = process.env.WEBMENTION_IO_TOKEN

const absoluteURL = (url, domain) => {
Expand Down Expand Up @@ -181,9 +179,14 @@ module.exports = (eleventyConfig, options = {}) => {
throw new Error("domain is a required option to be passed when adding the plugin to your eleventyConfig using addPlugin.")
}

// Liquid/Nunjucks Filters
eleventyConfig.addLiquidFilter("getWebmentions", getWebmentionsFilter)
eleventyConfig.addNunjucksAsyncFilter("getWebmentions", getWebmentionsFilter)

// Eleventy Data
eleventyConfig.addGlobalData("webmentions", filteredWebmentions)
} else {
// JavaScript
return filteredWebmentions
}
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chrisburnell/eleventy-cache-webmentions",
"version": "0.1.5",
"version": "0.1.6",
"description": "Cache webmentions from webmention.io using eleventy-cache-assets.",
"main": "eleventy-cache-webmentions.js",
"author": "Chris Burnell <me@chrisburnell.com>",
Expand All @@ -17,7 +17,6 @@
},
"dependencies": {
"@11ty/eleventy-cache-assets": "^2.3.0",
"dotenv": "^10.0.0",
"lodash": "^4.17.21",
"node-fetch": "2.6.5",
"sanitize-html": "^2.5.2"
Expand Down

0 comments on commit 098c546

Please sign in to comment.