mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
docs: make it clear for extnames, see #214
This commit is contained in:
@@ -45,8 +45,8 @@ LiquidJS defaults this option to <code>true</code> to be compatible with shopify
|
||||
**extname** defines the default extname to be appended into filenames if the filename has no extname. Defaults to `''` which means it's disabled by default. By setting it to `.liquid`:
|
||||
|
||||
```liquid
|
||||
{% render "foo" %} loads foo.liquid
|
||||
{% render "foo.html" %} loads foo.html
|
||||
{% render "foo" %} there's no extname, adds `.liquid` and loads foo.liquid
|
||||
{% render "foo.html" %} there is an extname already, loads foo.html directly
|
||||
```
|
||||
|
||||
{% note info Legacy Versions %}
|
||||
|
||||
@@ -12,9 +12,9 @@ color: '{{ color }}' shape: '{{ shape }}'
|
||||
|
||||
// file: theme.liquid
|
||||
{% assign shape = 'circle' %}
|
||||
{% render 'color' %}
|
||||
{% render 'color' with 'red' %}
|
||||
{% render 'color', color: 'yellow', shape: 'square' %}
|
||||
{% render 'color.liquid' %}
|
||||
{% render 'color.liquid' with 'red' %}
|
||||
{% render 'color.liquid', color: 'yellow', shape: 'square' %}
|
||||
```
|
||||
|
||||
The output will be:
|
||||
@@ -27,6 +27,10 @@ color: 'yellow' shape: 'square'
|
||||
|
||||
More details please refer to the [render](../tags/render.html) tag.
|
||||
|
||||
{% note tip The ".liquid" Extension %}
|
||||
The ".liquid" extension in <code>layout</code>, <code>render</code> and <code>include</code> an be omitted if Liquid instance is created using `extname: ".liquid"` option. See <a href="./options.html#extname">the extname option</a> for details.
|
||||
{% endnote %}
|
||||
|
||||
## Layout Templates (Extends)
|
||||
|
||||
For the following template files:
|
||||
@@ -38,7 +42,7 @@ Header
|
||||
Footer
|
||||
|
||||
// file: page.liquid
|
||||
{% layout "default-layout" %}
|
||||
{% layout "default-layout.liquid" %}
|
||||
{% block content %}My page content{% endblock %}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user