From 1412ca289a70319b89ca3c2abd447749e4e3959c Mon Sep 17 00:00:00 2001 From: harttle Date: Tue, 3 Mar 2020 00:41:39 +0800 Subject: [PATCH] docs: better document for partial lookups, closes #165 --- Render-a-File.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Render-a-File.md b/Render-a-File.md index 1a59229..86422ba 100644 --- a/Render-a-File.md +++ b/Render-a-File.md @@ -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 , only the first `root` will be used and the file to be fetched is: + +- + +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