mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 15:00:42 -07:00
tag: layout, block
This commit is contained in:
@@ -49,7 +49,9 @@ var html = engine.renderFile("hello.html", {name: 'alice'});
|
||||
|
||||
`cache` default to `false`, `extname` default to `.liquid`, `root` default to `""`.
|
||||
|
||||
## Include
|
||||
## Includes and Layouts
|
||||
|
||||
### Includes
|
||||
|
||||
```
|
||||
// file: color.liquid
|
||||
@@ -70,6 +72,30 @@ color: 'red' shape: 'circle'
|
||||
color: 'yellow' shape: 'square'
|
||||
```
|
||||
|
||||
### 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
|
||||
|
||||
Register Filters:
|
||||
@@ -131,6 +157,7 @@ Tag | Document | Source | Test
|
||||
`raw` | [Document](https://help.shopify.com/themes/liquid/tags/theme-tags#raw) | [Source](https://github.com/harttle/shopify-liquid/blob/master/tags/raw.js) | [Test][tt]
|
||||
`comment` | [Document](https://help.shopify.com/themes/liquid/tags/theme-tags#comment) | [Source](https://github.com/harttle/shopify-liquid/blob/master/tags/comment.js) | [Test][tt]
|
||||
`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]
|
||||
|
||||
|
||||
## Filters
|
||||
|
||||
Reference in New Issue
Block a user