mikser-io-render-liquid 1.1.0 → 1.1.1

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.
Files changed (2) hide show
  1. package/index.js +7 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -23,7 +23,13 @@ export async function render({ entity, options, runtime }) {
23
23
  engine.registerFilter(key, (input, ...args) => runtime[key](input, ...args))
24
24
  }
25
25
  }
26
- const name = path.relative(options.layoutsFolder, entity.layout.uri).replace(/\.liquid$/, '')
26
+ // Keep the `.liquid` in the name. LiquidJS's renderFile resolution
27
+ // skips its own `extname` append for names that already have a
28
+ // file-ish extension — and `path.extname('foo.html-pdf')` is
29
+ // `.html-pdf`, which Liquid treats as "extension already present".
30
+ // Stripping would make multi-segment layout names (e.g.
31
+ // `franchises.html-pdf.liquid`) fail with ENOENT.
32
+ const name = path.relative(options.layoutsFolder, entity.layout.uri)
27
33
  try {
28
34
  return await runtime.liquid(name, runtime)
29
35
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mikser-io-render-liquid",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",