@chrisburnell/eleventy-cache-webmentions 2.3.2 → 2.3.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.
- package/README.md +25 -4
- package/eleventy-cache-webmentions.cjs +4 -688
- package/eleventy-cache-webmentions.js +40 -675
- package/package.json +8 -6
- package/src/core.cjs +708 -0
- package/.cache/eleventy-fetch-68a403136c61abd104ade94e69ba62 +0 -1
- package/.cache/eleventy-fetch-68a403136c61abd104ade94e69ba62.json +0 -1
- package/eleventy-cache-webmentions.min.cjs +0 -1
- package/eleventy-cache-webmentions.min.js +0 -1
- package/eslint.config.js +0 -42
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> Cache webmentions using eleventy-fetch and make them available to use in collections, layouts, pages, etc. in Eleventy.
|
|
4
4
|
|
|
5
|
-
[](https://github.com/chrisburnell/eleventy-cache-webmentions/actions/workflows/npm-publish.yml) [](https://www.npmjs.com/package/@chrisburnell/eleventy-cache-webmentions)
|
|
6
|
-
|
|
7
5
|
## Breaking change for v2.0.0
|
|
8
6
|
|
|
9
7
|
Version 2.0.0 introduces a breaking change for those migrating from earlier versions of the plugin. This affects usage of the plugin from JavaScript files; specifically, you will need to make a small change to the way that you `require()` the plugin by removing an extra set of parentheses:
|
|
@@ -81,7 +79,7 @@ Make sure you get the correct values for this configuration. Check below for bot
|
|
|
81
79
|
<td>0.0.1</td>
|
|
82
80
|
</tr>
|
|
83
81
|
<tr>
|
|
84
|
-
<td><code>
|
|
82
|
+
<td><code>cacheDirectory</code></td>
|
|
85
83
|
<td><code>".cache"</code></td>
|
|
86
84
|
<td>See <a href="https://www.11ty.dev/docs/plugins/cache/#cache-directory">Eleventy Fetch’s Cache Directory</a> for more information.</td>
|
|
87
85
|
<td>1.1.2</td>
|
|
@@ -130,7 +128,7 @@ Make sure you get the correct values for this configuration. Check below for bot
|
|
|
130
128
|
</tr>
|
|
131
129
|
<tr>
|
|
132
130
|
<td><code>maximumHtmlLength</code></td>
|
|
133
|
-
<td><code>
|
|
131
|
+
<td><code>1000</code></td>
|
|
134
132
|
<td>Maximum number of characters in a Webmention’s HTML content, beyond which point a different message is shown, referring to the original source.</td>
|
|
135
133
|
<td>0.0.1</td>
|
|
136
134
|
</tr>
|
|
@@ -140,6 +138,12 @@ Make sure you get the correct values for this configuration. Check below for bot
|
|
|
140
138
|
<td>The glue-y part of the message displayed when a Webmention content’s character count exceeds <code>maximumHtmlLength</code>.</td>
|
|
141
139
|
<td>0.1.0</td>
|
|
142
140
|
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td><code>paginate</code></td>
|
|
143
|
+
<td><code>false</code></td>
|
|
144
|
+
<td>Loops through pages of results until none are found for Webmention servers that paginate their feeds (as <a href="#webmentionio">Webmention.io</a> does). Automatically enabled when the <code>feed</code> points at a <code>https://webmention.io</code> URL. Set this to <code>true</code> to also enable it for self-hosted <em>Webmention.io</em> instances running on a different domain.</td>
|
|
145
|
+
<td>2.3.3</td>
|
|
146
|
+
</tr>
|
|
143
147
|
</tbody>
|
|
144
148
|
</table>
|
|
145
149
|
</details>
|
|
@@ -344,6 +348,23 @@ module.exports = function(eleventyConfig) {
|
|
|
344
348
|
|
|
345
349
|
If you want to use the JSON format instead, make sure that you replace `mentions.jf2` in the URL with `mentions.json` and change the value of the key from `children` to `links`.
|
|
346
350
|
|
|
351
|
+
#### Self-hosting Webmention.io
|
|
352
|
+
|
|
353
|
+
Pagination through the feed (see the `paginate` option above) is automatically enabled whenever `feed` points at `https://webmention.io`. If you're instead running your own self-hosted instance of the [open-source Webmention.io software](https://github.com/aaronpk/webmention.io) on a different domain, add `paginate: true` explicitly so the plugin still loops through pages of results:
|
|
354
|
+
|
|
355
|
+
```javascript
|
|
356
|
+
const pluginWebmentions = require("@chrisburnell/eleventy-cache-webmentions")
|
|
357
|
+
|
|
358
|
+
module.exports = function(eleventyConfig) {
|
|
359
|
+
eleventyConfig.addPlugin(pluginWebmentions, {
|
|
360
|
+
domain: "https://example.com",
|
|
361
|
+
feed: `https://webmentions.example.com/api/mentions.jf2?domain=example.com&token=${process.env.WEBMENTION_IO_TOKEN}`,
|
|
362
|
+
key: "children",
|
|
363
|
+
paginate: true
|
|
364
|
+
})
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
347
368
|
## go-jamming
|
|
348
369
|
|
|
349
370
|
[go-jamming](https://git.brainbaking.com/wgroeneveld/go-jamming) is a self-hosted Webmention sender and receiver, built in Go by [Wouter Groeneveld](https://brainbaking.com) and available with more information on his [personal git instance](https://git.brainbaking.com/wgroeneveld/go-jamming).
|