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.
- package/index.js +7 -1
- 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
|
-
|
|
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) {
|