mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
Deploying to gh-pages from @ harttle/liquidjs@371da3da74 🚀
This commit is contained in:
@@ -116,14 +116,16 @@
|
||||
<blockquote class="note warn"><strong class="note-title">Common Pitfall</strong><p>LiquidJS defaults this option to <code>true</code> to be compatible with shopify/liquid, but if you’re from <a href="https://github.com/11ty/eleventy" rel="external nofollow noreferrer" target="_blank">eleventy</a> it’s set to <code>false</code> by default (see <a href="https://www.11ty.dev/docs/languages/liquid/#quoted-include-paths" rel="external nofollow noreferrer" target="_blank">Quoted Include Paths</a>) which I believe is trying to be compatible with Jekyll.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="Jekyll-include" class="article-heading"><a href="#Jekyll-include" class="headerlink" title="Jekyll include"></a>Jekyll include<a class="article-anchor" href="#Jekyll-include" aria-hidden="true"></a></h2><p><a href="../api/interfaces/liquid_options_.liquidoptions.html#Optional-jekyllInclude">jekyllInclude</a> is used to enable Jekyll-like include syntax. Defaults to <code>false</code>, when set to <code>true</code>:</p>
|
||||
<h2 id="Jekyll-include" class="article-heading"><a href="#Jekyll-include" class="headerlink" title="Jekyll include"></a>Jekyll include<a class="article-anchor" href="#Jekyll-include" aria-hidden="true"></a></h2><p class="since">v9.33.0</p>
|
||||
|
||||
<p><a href="../api/interfaces/liquid_options_.liquidoptions.html#Optional-jekyllInclude">jekyllInclude</a> is used to enable Jekyll-like include syntax. Defaults to <code>false</code>, when set to <code>true</code>:</p>
|
||||
<ul>
|
||||
<li>Filename will be static: <code>dynamicPartials</code> now defaults to <code>false</code> (instead of <code>true</code>). And you can set <code>dynamicPartials</code> back to <code>true</code>.</li>
|
||||
<li>Use <code>=</code> instead of <code>:</code> to separate parameter key-values.</li>
|
||||
<li>Parameters are under <code>include</code> variable instead of current scope.</li>
|
||||
</ul>
|
||||
<p>For example in the following template, <code>name.html</code> is not quoted, <code>header</code> and <code>"HEADER"</code> are separated by <code>=</code>, and the <code>header</code> parameter is referenced by <code>include.header</code>. More details please check out <a href="../tags/include.html">include</a>.</p>
|
||||
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">// entry template</span><br><span class="line">{% include name.html header="HEADER" content="CONTENT" %}</span><br><span class="line"></span><br><span class="line">// name.html</span><br><span class="line"><header>{{include.header}}</header></span><br><span class="line">{{include.content}}</span><br></pre></td></tr></table></figure>
|
||||
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">// entry template</span><br><span class="line">{% include article.html header="HEADER" content="CONTENT" %}</span><br><span class="line"></span><br><span class="line">// article.html</span><br><span class="line"><article></span><br><span class="line"> <header>{{include.header}}</header></span><br><span class="line"> {{include.content}}</span><br><span class="line"></article></span><br></pre></td></tr></table></figure>
|
||||
|
||||
<h2 id="extname" class="article-heading"><a href="#extname" class="headerlink" title="extname"></a>extname<a class="article-anchor" href="#extname" aria-hidden="true"></a></h2><p><strong>extname</strong> defines the default extension name to be appended into filenames if the filename has no extension name. Defaults to <code>''</code> which means it’s disabled by default. By setting it to <code>.liquid</code>:</p>
|
||||
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">{% render "foo" %} there's no extname, adds `.liquid` and loads foo.liquid</span><br><span class="line">{% render "foo.html" %} there is an extname already, loads foo.html directly</span><br></pre></td></tr></table></figure>
|
||||
@@ -151,7 +153,7 @@
|
||||
|
||||
</div>
|
||||
<footer class="article-footer">
|
||||
<time class="article-footer-updated" datetime="2022-01-19T17:39:45.280Z" itemprop="dateModified">Last updated: 2022-01-19</time>
|
||||
<time class="article-footer-updated" datetime="2022-01-19T18:05:53.677Z" itemprop="dateModified">Last updated: 2022-01-19</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>
|
||||
|
||||
Reference in New Issue
Block a user