mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
docs: better document for partial lookups, closes #165
+8
-3
@@ -47,14 +47,19 @@ var engine = new Liquid({
|
||||
});
|
||||
```
|
||||
|
||||
When `{% render "foo" %}` is renderd or `liquid.renderFile('foo')` is called, the following files will be looked up and the first existing file will be used (if none of them exists an `ENOENT` error will be throwed):
|
||||
When `{% render "foo" %}` is renderd or `liquid.renderFile('foo')` is called, the following files will be looked up and the first existing file will be used:
|
||||
|
||||
- `pwd`/views/foo.liquid
|
||||
- `pwd`/views/partials/foo.liquid
|
||||
|
||||
When LiquidJS is used in browser, say current location is `https://harttle.com/bar/index.html`, only the first `root` will be used and the file to be fetched is (if fetch fails an `ENOENT` error will be throwed):
|
||||
If none of the above files exists, an `ENOENT` error will be throwed. Here's a demo for Node.js: [demo/nodejs](https://github.com/harttle/liquidjs/tree/master/demo/nodejs).
|
||||
|
||||
- `https://harttle.com/bar/foo.liquid`
|
||||
When LiquidJS is used in browser, say current location is <https://example.com/bar/index.html>, only the first `root` will be used and the file to be fetched is:
|
||||
|
||||
- <https://example.com/bar/foo.liquid>
|
||||
|
||||
If fetch fails, a 404/500 error or network failures for example, an `ENOENT` error will be throwed.
|
||||
Here's a demo for browsers: [demo/browser](https://github.com/harttle/liquidjs/tree/master/demo/browser).
|
||||
|
||||
## Abstract File System
|
||||
|
||||
|
||||
Reference in New Issue
Block a user