shopify-liquid
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -61,3 +61,3 @@ const scope = require('./src/scope'); | ||
var tpl = this.options.cache && this.cache[filepath] || | ||
this.parse(fs.readFileSync(filepath)); | ||
this.parse(fs.readFileSync(filepath, 'utf8')); | ||
return this.options.cache ? (this.cache[filepath] = tpl) : tpl; | ||
@@ -64,0 +64,0 @@ } |
{ | ||
"name": "shopify-liquid", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "A Shopify Liquid Implementation in Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,4 +52,6 @@ # shopify-liquid | ||
## Include | ||
## Includes and Layouts | ||
### Includes | ||
``` | ||
@@ -74,2 +76,26 @@ // file: color.liquid | ||
### Layouts | ||
``` | ||
// file: default-layout.html | ||
Header | ||
{% block content %}My default content{% endblock %} | ||
Footer | ||
// file: page.html | ||
{% layout "default-layout" %} | ||
{% block content %}My page content{% endblock %} | ||
``` | ||
The output of `page.html`: | ||
``` | ||
Header | ||
My page content | ||
Footer | ||
``` | ||
* It's possible to define multiple blocks. | ||
* block name is optional when there's only one block. | ||
## Extension | ||
@@ -136,2 +162,3 @@ | ||
`include` | [Document](https://help.shopify.com/themes/liquid/tags/theme-tags#include) | [Source](https://github.com/harttle/shopify-liquid/blob/master/tags/include.js) | [Test][tt] | ||
`layout, block` | [Document](http://docs.mixture.io/templates/) | [Source](https://github.com/harttle/shopify-liquid/blob/master/tags/layout.js) | [Test][tt] | ||
@@ -138,0 +165,0 @@ |
@@ -11,3 +11,2 @@ const _ = require('lodash'); | ||
} | ||
return ''; | ||
}, | ||
@@ -14,0 +13,0 @@ set: function(k, v) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
55757
31
1073
230
0