mikser-io-render-liquid 1.1.0 → 2.0.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 +2 -0
- package/index.js +7 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[LiquidJS](https://www.npmjs.com/package/liquidjs) renderer for [Mikser](https://github.com/almero-digital-marketing/mikser-io). Renders entities whose layout uses the `.liquid` template engine.
|
|
4
4
|
|
|
5
|
+
Mikser doesn't pick your template engine for you — install the renderer that matches the syntax your team already knows. Liquid is the templating syntax behind Shopify, Jekyll, and Eleventy — designer-friendly, safe by default, deeply familiar to anyone who has touched a Jekyll site. Mix freely with other engines in the same project (`.liquid`, `.hbs`, `.eta` can all coexist).
|
|
6
|
+
|
|
5
7
|
## Install
|
|
6
8
|
|
|
7
9
|
```bash
|
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) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mikser-io-render-liquid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/almero-digital-marketing/mikser-io-render-liquid#readme",
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"mikser-io": "^
|
|
19
|
+
"mikser-io": "^7.0.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"liquidjs": "^10.16.0"
|