eleventy-plugin-asciidoc 1.2.1 → 1.3.0

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 CHANGED
@@ -4,7 +4,7 @@ Eleventy plugin to add support for [AsciiDoc](https://asciidoc.org/). You don't
4
4
 
5
5
  The plugin uses [Asciidoctor.js](https://docs.asciidoctor.org/asciidoctor.js) under the hood.
6
6
 
7
- **Requires Eleventy `1.0.0` or newer.**
7
+ **Requires Eleventy 1.0.0-beta.10, 1.0.0-canary.50 or newer.**
8
8
 
9
9
  ## Features
10
10
 
@@ -4,7 +4,6 @@ const asciidoctor = require("asciidoctor").default();
4
4
  const debug = require("debug")("eleventy-plugin-asciidoc");
5
5
  const fs = require("fs");
6
6
  const matter = require("gray-matter");
7
- const nunjucks = require("nunjucks");
8
7
 
9
8
  /** @typedef {import('asciidoctor').Asciidoctor.ProcessorOptions} ProcessorOptions */
10
9
  /** @typedef {import('gray-matter').GrayMatterFile} GrayMatterFile */
@@ -54,17 +53,9 @@ function eleventyAsciidoctor(convertOptions = {}) {
54
53
  ...convertOptions,
55
54
  };
56
55
 
57
- const compile = (str) => (data) => {
58
- if (str) {
59
- // Since `read: false` is set 11ty doesn't read file contents
60
- // so if str has a value, it's a permalink (which can be a string or a function)
61
- return typeof str === "function"
62
- ? str(data)
63
- : nunjucks.renderString(str, data);
64
- }
65
-
66
- debug(`Reading ${data.page.inputPath}`);
67
- const { content } = readFileSync(data.page.inputPath);
56
+ const compile = (_, inputPath) => () => {
57
+ debug(`Reading ${inputPath}`);
58
+ const { content } = readFileSync(inputPath);
68
59
 
69
60
  if (content) {
70
61
  debug(`Converting:\n ${content}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-asciidoc",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Adds support for AsciiDoc to Eleventy",
5
5
  "main": ".eleventy.js",
6
6
  "repository": {