Deploying to gh-pages from @ harttle/liquidjs@3cd024d652 🚀

This commit is contained in:
harttle
2026-03-07 18:37:00 +00:00
parent 5d6d732b19
commit b38269a75b
249 changed files with 1256 additions and 1259 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ engine<span class="token punctuation">.</span><span class="token function">regis
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.250Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.753Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="register-filters-tags.html" class="article-footer-prev" title="Register Filters/Tags"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="parse-parameters.html" class="article-footer-next" title="Parse Parameters"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -123,7 +123,7 @@ engine<span class="token punctuation">.</span><span class="token function">rende
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.753Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="use-in-expressjs.html" class="article-footer-prev" title="Use in Express.js"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="escaping.html" class="article-footer-next" title="Escaping"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -809,7 +809,7 @@
</script></li></ul>
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:42.972Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:49.778Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="migrate-to-9.html" class="article-footer-prev" title="Migrate to LiquidJS 9"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="differences.html" class="article-footer-next" title="Differences with Shopify/liquid"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -104,7 +104,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.753Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="differences.html" class="article-footer-prev" title="Differences with Shopify/liquid"><i class="icon-chevron-left"></i><span>Prev</span></a>
</footer>
</div>
+1 -1
View File
@@ -126,7 +126,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.753Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="changelog.html" class="article-footer-prev" title="Changelog"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="contribution-guidelines.html" class="article-footer-next" title="Contribution Guidelines"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -120,7 +120,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.753Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="truthy-and-falsy.html" class="article-footer-prev" title="Truthy and Falsy"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="static-analysis.html" class="article-footer-next" title="Static Analysis"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -237,7 +237,7 @@ engine<span class="token punctuation">.</span><span class="token function">parse
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="render-tag-content.html" class="article-footer-prev" title="Render Tag Content"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="sync-and-async.html" class="article-footer-next" title="Sync and Async"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -135,7 +135,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="caching.html" class="article-footer-prev" title="Caching"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="register-filters-tags.html" class="article-footer-next" title="Register Filters/Tags"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -125,7 +125,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="setup.html" class="article-footer-next" title="Setup"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -116,7 +116,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="static-analysis.html" class="article-footer-prev" title="Static Analysis"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="changelog.html" class="article-footer-next" title="Changelog"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -131,7 +131,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="plugins.html" class="article-footer-prev" title="Plugins"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="truthy-and-falsy.html" class="article-footer-next" title="Truthy and Falsy"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -173,7 +173,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="setup.html" class="article-footer-prev" title="Setup"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="render-file.html" class="article-footer-next" title="Render Files"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -161,7 +161,7 @@ engine<span class="token punctuation">.</span><span class="token function">regis
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="access-scope-in-filters.html" class="article-footer-prev" title="Access Scope in Filters"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="render-tag-content.html" class="article-footer-next" title="Render Tag Content"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -130,7 +130,7 @@ Footer<span aria-hidden="true" class="line-numbers-rows"><span></span><span></sp
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="render-file.html" class="article-footer-prev" title="Render Files"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="use-in-expressjs.html" class="article-footer-next" title="Use in Express.js"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -121,7 +121,7 @@ engine
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="whitespace-control.html" class="article-footer-prev" title="Whitespace Control"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="operators.html" class="article-footer-next" title="Operators"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -153,7 +153,7 @@ engine<span class="token punctuation">.</span><span class="token function">regis
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="escaping.html" class="article-footer-prev" title="Escaping"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="access-scope-in-filters.html" class="article-footer-next" title="Access Scope in Filters"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+9 -12
View File
@@ -116,24 +116,21 @@ name: alice<span aria-hidden="true" class="line-numbers-rows"><span></span><span
<h2 id="Template-Lookup" class="article-heading"><a href="#Template-Lookup" class="headerlink" title="Template Lookup"></a>Template Lookup<a class="article-anchor" href="#Template-Lookup" aria-hidden="true"></a></h2><p>Template files names passed to <a href="/api/classes/Liquid.html#renderFile">renderFile</a>, <a href="/api/classes/Liquid.html#parseFile">parseFile</a>, <a href="/api/classes/Liquid.html#renderFileSync">renderFileSync</a>, <a href="/api/classes/Liquid.html#parseFileSync">parseFileSync</a> APIs,<br>and <a target="_blank" rel="noopener external nofollow noreferrer" href="https://help.shopify.com/themes/liquid/tags/theme-tags#include">include</a>, <a target="_blank" rel="noopener external nofollow noreferrer" href="https://help.shopify.com/en/themes/liquid/tags/theme-tags#layout">layout</a> tags are resolved against <a href="/api/interfaces/LiquidOptions.html#root">the root option</a>.</p>
<p>It can be a string-typed path (see above example), or a list of root directories, in which case templates will be looked up in that order. e.g.</p>
<pre class="line-numbers language-javascript" data-language="javascript"><code class="language-javascript"><span class="token keyword">var</span> engine <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Liquid</span><span class="token punctuation">(</span><span class="token punctuation">&#123;</span>
<span class="token literal-property property">root</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">'views/'</span><span class="token punctuation">,</span> <span class="token string">'views/partials/'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token literal-property property">root</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">'views/'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token literal-property property">partials</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">'views/partials/'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token literal-property property">layouts</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">'views/layouts/'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token literal-property property">extname</span><span class="token operator">:</span> <span class="token string">'.liquid'</span>
<span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
<span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<blockquote class="note tip"><strong class="note-title">Relative Paths</strong><p>Relative paths in <code>root</code> will be resolved against <code>cwd()</code>.</p>
</blockquote>
<p>When <code>{% render "foo" %}</code> is rendered or <code>liquid.renderFile(&#39;foo&#39;)</code> is called, the following files will be looked up and the first existing file will be used:</p>
<ul>
<li><code>cwd()</code>/views/foo.liquid</li>
<li><code>cwd()</code>/views/partials/foo.liquid</li>
<li>When <code>parse()</code>, <code>render()</code> functions are called, for example <code>liquid.renderFile(&#39;foo&#39;)</code>, templates under <code>root</code> will be looked up.</li>
<li>When a partial is requested, for example <code>{% render "foo" %}</code>, templates under <code>partials</code> will be looked up.</li>
<li>When a layout is requested, for example <code>{% layout "foo" %}</code>, templates under <code>layouts</code> will be looked up.</li>
</ul>
<p>If none of the above files exists, an <code>ENOENT</code> error will be thrown. Heres a demo for Node.js: <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/harttle/liquidjs/tree/master/demo/nodejs">demo/nodejs</a>.</p>
<p>When LiquidJS is used in browser, say current location is <a target="_blank" rel="noopener external nofollow noreferrer" href="https://example.com/bar/index.html">https://example.com/bar/index.html</a>, only the first <code>root</code> will be used and the file to be fetched is:</p>
<ul>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://example.com/bar/foo.liquid">https://example.com/bar/foo.liquid</a></li>
</ul>
<p>If fetch fails, a 404/500 error or network failures for example, an <code>ENOENT</code> error will be thrown.<br>Heres a demo for browsers: <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/harttle/liquidjs/tree/master/demo/browser">demo/browser</a>.</p>
<p>When LiquidJS is used in browser, the paths will be resolved based on current location. Heres a demo for browsers: <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/harttle/liquidjs/tree/master/demo/browser">demo/browser</a>.</p>
<h2 id="Abstract-File-System" class="article-heading"><a href="#Abstract-File-System" class="headerlink" title="Abstract File System"></a>Abstract File System<a class="article-anchor" href="#Abstract-File-System" aria-hidden="true"></a></h2><p>LiquidJS defines an <a href="/api/interfaces/FS.html">abstract file system interface</a> and the default implementation is <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/harttle/liquidjs/blob/master/src/fs/fs-impl.ts">src/fs/fs-impl.ts</a> for Node.js and <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/harttle/liquidjs/blob/master/src/fs/fs-impl-browser.ts">src/build/fs-impl-browser.ts</a> for the browser bundle.</p>
<p>The <code>Liquid</code> constructor provides a <a href="/api/interfaces/LiquidOptions.html#fs">fs</a> option to specify the file system implementation. Its supposed to be used to define customized template fetching logic, i.e. fetch template from a database table, like:</p>
<pre class="line-numbers language-javascript" data-language="javascript"><code class="language-javascript"><span class="token keyword">var</span> engine <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Liquid</span><span class="token punctuation">(</span><span class="token punctuation">&#123;</span>
@@ -177,7 +174,7 @@ engine<span class="token punctuation">.</span><span class="token function">rende
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="options.html" class="article-footer-prev" title="Options"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="partials-and-layouts.html" class="article-footer-next" title="Includes and Layouts"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -188,7 +188,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="parse-parameters.html" class="article-footer-prev" title="Parse Parameters"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="drops.html" class="article-footer-next" title="Liquid Drops"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -155,7 +155,7 @@ npx liquidjs <span class="token parameter variable">--template</span> <span clas
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="intro-to-liquid.html" class="article-footer-prev" title="Intro to Liquid"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="options.html" class="article-footer-next" title="Options"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -317,7 +317,7 @@ engine<span class="token punctuation">.</span><span class="token function">globa
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="dos.html" class="article-footer-prev" title="DoS"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="migrate-to-9.html" class="article-footer-next" title="Migrate to LiquidJS 9"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -180,7 +180,7 @@ engine<span class="token punctuation">.</span><span class="token function">regis
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="drops.html" class="article-footer-prev" title="Liquid Drops"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="whitespace-control.html" class="article-footer-next" title="Whitespace Control"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -226,7 +226,7 @@
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="operators.html" class="article-footer-prev" title="Operators"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="dos.html" class="article-footer-next" title="DoS"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -134,7 +134,7 @@ res<span class="token punctuation">.</span><span class="token function">render</
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="partials-and-layouts.html" class="article-footer-prev" title="Includes and Layouts"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="caching.html" class="article-footer-next" title="Caching"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>
+1 -1
View File
@@ -121,7 +121,7 @@ harttle<span aria-hidden="true" class="line-numbers-rows"><span></span><span></s
</div>
<footer class="article-footer">
<time class="article-footer-updated" datetime="2026-02-14T05:54:16.251Z" itemprop="dateModified">Last updated: 2026-02-14</time>
<time class="article-footer-updated" datetime="2026-03-07T18:36:21.754Z" itemprop="dateModified">Last updated: 2026-03-07</time>
<a href="sync-and-async.html" class="article-footer-prev" title="Sync and Async"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="plugins.html" class="article-footer-next" title="Plugins"><span>Next</span><i class="icon-chevron-right"></i></a>
</footer>
</div>