mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 15:00:42 -07:00
update README
This commit is contained in:
@@ -44,7 +44,7 @@ var engine = Liquid({
|
|||||||
cache: false
|
cache: false
|
||||||
});
|
});
|
||||||
// equivalent to: engine.renderFile("hello", {name: 'alice'});
|
// equivalent to: engine.renderFile("hello", {name: 'alice'});
|
||||||
var html = engine.renderFile("hello.html", {name: 'alice'});
|
var html = engine.renderFile("hello.liquid", {name: 'alice'});
|
||||||
```
|
```
|
||||||
|
|
||||||
`cache` default to `false`, `extname` default to `.liquid`, `root` default to `""`.
|
`cache` default to `false`, `extname` default to `.liquid`, `root` default to `""`.
|
||||||
@@ -81,17 +81,17 @@ color: 'yellow' shape: 'square'
|
|||||||
## Layouts
|
## Layouts
|
||||||
|
|
||||||
```
|
```
|
||||||
// file: default-layout.html
|
// file: default-layout.liquid
|
||||||
Header
|
Header
|
||||||
{% block content %}My default content{% endblock %}
|
{% block content %}My default content{% endblock %}
|
||||||
Footer
|
Footer
|
||||||
|
|
||||||
// file: page.html
|
// file: page.liquid
|
||||||
{% layout "default-layout" %}
|
{% layout "default-layout" %}
|
||||||
{% block content %}My page content{% endblock %}
|
{% block content %}My page content{% endblock %}
|
||||||
```
|
```
|
||||||
|
|
||||||
The output of `page.html`:
|
The output of `page.liquid`:
|
||||||
|
|
||||||
```
|
```
|
||||||
Header
|
Header
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "shopify-liquid",
|
"name": "shopify-liquid",
|
||||||
"version": "1.1.6",
|
"version": "1.1.7",
|
||||||
"description": "A Shopify Liquid Implementation in Node.js",
|
"description": "A Shopify Liquid Implementation in Node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user