<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://cecil.app/xsl/atom.xsl" media="all"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://cecil.app/documentation/assets/</id>
  <title>Cecil - Assets</title>
  <subtitle><![CDATA[Cecil is a command-line PHP application that merges Markdown pages, medias and Twig templates to generate a static website.]]></subtitle>
  <link href="https://cecil.app/documentation/assets/atom.xml" rel="self" type="application/atom+xml" />
  <link href="https://cecil.app/documentation/assets/" rel="alternate" type="text/html" />
  <updated>2026-10-06T00:33:56+00:00</updated>
  <author>
    <name>Cecil</name>
    <uri>https://cecil.app</uri>
  </author>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/assets/cdn-providers/</id>
    <title>CDN providers</title>
    <published>2023-10-23T00:00:00+00:00</published>
    <updated>2026-10-02T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/assets/cdn-providers/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>CDN providers</h1>
<p>Examples of CDN providers <a href="/documentation/configuration/assets/#assets-images-cdn"><code translate="no">configuration</code></a>.</p>
<h2 id="cloudinary">Cloudinary</h2>
<p><a href="https://cloudinary.com" target="_blank" rel="noopener noreferrer">https://cloudinary.com</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://res.cloudinary.com/%account%/image/fetch/c_limit,w_%width%,q_%quality%,f_%format%,d_default/%image_url%'</span></code></pre>
<h2 id="cloudimage">Cloudimage</h2>
<p><a href="https://www.cloudimage.io" target="_blank" rel="noopener noreferrer">https://www.cloudimage.io</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://%account%.cloudimg.io/%image_url%?w=%width%&amp;q=%quality%&amp;force_format=%format%'</span></code></pre>
<h2 id="twicpics">TwicPics</h2>
<p><a href="https://www.twicpics.com" target="_blank" rel="noopener noreferrer">https://www.twicpics.com</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">remote:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://%account%.twic.pics/%image_url%?twic=v1/resize=%width%/quality=%quality%/output=%format%'</span></code></pre>
<p><code translate="no">Source URL</code>: Your website <code translate="no">baseurl</code>.</p>
<h2 id="imgix">imgix</h2>
<p><a href="https://imgix.com" target="_blank" rel="noopener noreferrer">https://imgix.com</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">remote:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://%account%.imgix.net/%image_url%?w=%width%&amp;q=%quality%&amp;fm=%format%'</span></code></pre>
<p><code translate="no">Base URL</code>: Your website <code translate="no">baseurl</code>.</p>
<h2 id="netlify-image-cdn">Netlify Image CDN</h2>
<p><a href="https://docs.netlify.com/image-cdn/overview/" target="_blank" rel="noopener noreferrer">https://docs.netlify.com/image-cdn/overview/</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'/.netlify/images?url=%image_url%&amp;w=%width%&amp;fm=%format%'</span></code></pre>
<h3 id="run-locally">Run locally</h3>
<h4>Setup Netlify CLI</h4>
<pre><code class="language-bash hljs bash" translate="no">npm install netlify-cli -g
netlify link</code></pre>
<p><code translate="no">netlify.toml</code>:</p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-string">[dev]</span>
  <span class="hljs-string">targetPort</span> <span class="hljs-string">=</span> <span class="hljs-number">8000</span></code></pre>
<h4>Run local server</h4>
<pre><code class="language-bash hljs bash" translate="no">php cecil.phar serve &amp; netlify dev</code></pre>
<p>Open <a href="http://localhost:8888" target="_blank" rel="noopener noreferrer">http://localhost:8888</a></p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/assets/images/</id>
    <title>Images</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-05T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/assets/images/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Images</h1>
<h2 id="image-srcset">image_srcset</h2>
<p>Builds the HTML img <code translate="no">srcset</code> (responsive) attribute of an image Asset.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_srcset(asset) }}</span></code></pre>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> asset = asset(image_path) %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"asset"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_srcset(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">sizes</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_sizes('asset') }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span></code></pre>
<h2 id="image-sizes">image_sizes</h2>
<p>Returns the HTML img <code translate="no">sizes</code> attribute based on a CSS class name.<br>
It should be use in conjunction with the <a href="/documentation/assets/images/#image-srcset"><code translate="no">image_srcset</code></a> function.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_sizes('class') }}</span></code></pre>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> asset = asset(image_path) %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"asset"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_srcset(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">sizes</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_sizes('asset') }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span></code></pre>
<h2 id="image-from-website">image_from_website</h2>
<p>Builds the HTML img element from a website URL by extracting its illustration image.
Returns <code translate="no">null</code> if no image is found.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_from_website('url', {attributes}, {options}) }}</span></code></pre>
<p>The image is searched in the page HTML with the following fallbacks, the first candidate that can be downloaded as an image is used:</p>
<ol>
<li>Open Graph: <code translate="no">og:image:secure_url</code>, <code translate="no">og:image</code>, <code translate="no">og:image:url</code></li>
<li>Twitter: <code translate="no">twitter:image</code>, <code translate="no">twitter:image:src</code></li>
<li><code translate="no">&lt;link rel="image_src"&gt;</code></li>
<li>Microdata: <code translate="no">itemprop="image"</code></li>
<li>JSON-LD: <code translate="no">image</code> property</li>
<li>First <code translate="no">&lt;img&gt;</code> of <code translate="no">&lt;article&gt;</code>, <code translate="no">&lt;main&gt;</code> or <code translate="no">&lt;body&gt;</code></li>
<li><code translate="no">&lt;link rel="apple-touch-icon"&gt;</code></li>
<li><code translate="no">&lt;link rel="icon"&gt;</code></li>
</ol>
<p>Relative URLs are resolved against <code translate="no">&lt;base href&gt;</code> or the page URL.</p>
<p>The resolved image URL and the downloaded image are cached (see <a href="/documentation/configuration/cache/"><code translate="no">cache.assets.remote.ttl</code></a>).</p>
<p>Options:</p>
<ul>
<li><code translate="no">fallback</code>: image path (or URL) used if no image is found</li>
<li>other <a href="/documentation/templates/reference/functions/#html"><code translate="no">image</code></a> options (e.g.: <code translate="no">responsive</code>, <code translate="no">formats</code>)</li>
</ul>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_from_website('https://example.com/page-with-image.html') }}</span><span class="xml">

</span><span class="hljs-comment">{# with a fallback image #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ image_from_website('https://example.com/', {alt: 'Illustration'}, {fallback: 'images/default.png'}) }}</span></code></pre>
<h2 id="resize">resize</h2>
<p>Resizes an image to a specified width (in pixels) or/and height (in pixels).</p>
<ul>
<li>If only the width is specified, the height is calculated to preserve the aspect ratio</li>
<li>If only the height is specified, the width is calculated to preserve the aspect ratio</li>
<li>If both width and height are specified, the image is resized to fit within the given dimensions, image is cropped and centered if necessary</li>
<li>If remove_animation is true, any animation in the image (e.g., GIF) will be removed</li>
</ul>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|resize(width: width, height: height, remove_animation: bool) }}</span></code></pre>
<aside class="note note-info"><p>The original file is not altered and the resized version is saved at <code translate="no">/thumbnails/&lt;width&gt;x&lt;height&gt;/image.jpg</code>.</p></aside>
<aside class="note note-tip"><p>ICO files are supported: the largest icon is resized and saved as a single icon ICO file (PNG compressed). Icons stored as BMP with a color depth other than 24 or 32 bits require the <a href="https://www.php.net/manual/book.imagick.php" target="_blank" rel="noopener noreferrer">Imagick</a> PHP extension: otherwise, the original ICO file is kept and a warning is logged.</p></aside>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(page.image)|resize(300) }}</span><span class="xml">
</span><span class="hljs-comment">{# equivalent to: #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(width: 300) }}</span><span class="xml">
</span><span class="hljs-comment">{# resizes to 300px width, height auto-calculated to preserve aspect ratio #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(height: 200) }}</span><span class="xml">
</span><span class="hljs-comment">{# resizes to 300px width and 200px height, and crops if necessary #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(300, 200) }}</span><span class="xml">
</span><span class="hljs-comment">{# removes any animation from the image #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(width: 1200, height: 630, remove_animation: true) }}</span></code></pre>
<h2 id="cover">cover</h2>
<p>Resizes an image to a specified width and height, cropping it if necessary.</p>
<aside class="note note-warning"><p>The <code translate="no">cover</code> filter is deprecated since version <ins>8.77</ins> and will be removed in future versions. Use the <a href="#resize"><code translate="no">resize</code></a> filter instead, with both width and height parameters.</p></aside>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|cover(width, height) }}</span></code></pre>
<p><em>Example:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(page.image)|cover(1200, 630) }}</span></code></pre>
<h2 id="maskable">maskable</h2>
<p>Adds padding, in pourcentages, to an image to make it maskable.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|maskable(padding) }}</span></code></pre>
<p><em>Example:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('icon.png')|maskable }}</span></code></pre>
<h2 id="webp">webp</h2>
<p>Converts an image to <a href="https://developers.google.com/speed/webp" target="_blank" rel="noopener noreferrer">WebP</a> format.</p>
<p><em>Example:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">picture</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">source</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/webp"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path)|webp }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset(image_path)) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">picture</span>&gt;</span></span></code></pre>
<h2 id="avif">avif</h2>
<p>Converts an image to <a href="https://github.com/AOMediaCodec/libavif" target="_blank" rel="noopener noreferrer">AVIF</a> format.</p>
<p><em>Example:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">picture</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">source</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/avif"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path)|avif }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset(image_path)) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">picture</span>&gt;</span></span></code></pre>
<h2 id="lqip">lqip</h2>
<p>Returns a <a href="https://www.guypo.com/introducing-lqip-low-quality-image-placeholders" target="_blank" rel="noopener noreferrer">Low Quality Image Placeholder</a> (100x100 px, 50% blurred) as data URL.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|lqip }}</span></code></pre>
<h2 id="dominant-color">dominant_color</h2>
<p>Returns the dominant <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color" target="_blank" rel="noopener noreferrer">hexadecimal color</a> of an image.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|dominant_color }}</span></code></pre>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/assets/processing/</id>
    <title>CSS, JavaScript and processing</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-05T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/assets/processing/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>CSS, JavaScript and processing</h1>
<h2 id="fingerprint">fingerprint</h2>
<p>Add the file content finger print to the file name.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|fingerprint }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ path|fingerprint }}</span></code></pre>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|fingerprint }}</span></code></pre>
<h2 id="minify">minify</h2>
<p>Minifying a CSS or a JavaScript file.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|minify }}</span></code></pre>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|minify }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset('scripts.js')|minify }}</span></code></pre>
<h2 id="minify-css">minify_css</h2>
<p>Minifying a CSS string.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|minify_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_css %}</span><span class="xml">
</span><span class="hljs-comment">{# CSS here #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span></code></pre>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> styles = 'some CSS here' %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ styles|minify_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_css %}</span><span class="xml"><span class="css">
  <span class="hljs-selector-tag">html</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fcfcfc</span>;
    <span class="hljs-attribute">color</span>: <span class="hljs-number">#444</span>;
  }
</span></span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span></span></code></pre>
<h2 id="minify-js">minify_js</h2>
<p>Minifying a JavaScript string.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|minify_js }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_js %}</span><span class="xml">
</span><span class="hljs-comment">{# JavaScript here #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span></code></pre>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> script = 'some JavaScript here' %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ script|minify_js }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_js %}</span><span class="xml"><span class="javascript">
  <span class="hljs-keyword">var</span> test = <span class="hljs-string">'test'</span>;
  <span class="hljs-built_in">console</span>.log(test);
</span></span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></span></code></pre>
<h2 id="scss-to-css">scss_to_css</h2>
<p>Compiles a <a href="https://sass-lang.com" target="_blank" rel="noopener noreferrer">Sass</a> string to CSS.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|scss_to_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> scss_to_css %}</span><span class="xml">
</span><span class="hljs-comment">{# SCSS here #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span></code></pre>
<p>Alias: <code translate="no">sass_to_css</code>.</p>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> scss = 'some SCSS here' %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ scss|scss_to_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> scss_to_css %}</span><span class="xml">
  $color: #fcfcfc;
  div {
    color: lighten($color, 20%);
  }
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span></span></code></pre>
<h2 id="to-css">to_css</h2>
<p>Compiles a <a href="https://sass-lang.com" target="_blank" rel="noopener noreferrer">Sass</a> file to CSS.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|to_css }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ path|to_css }}</span></code></pre>
<p><em>Examples:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.scss')|to_css }}</span></code></pre>
<h2 id="inline">inline</h2>
<p>Outputs the content of an <em>Asset</em>.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|inline }}</span></code></pre>
<p><em>Example:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|inline }}</span></code></pre>
<h2 id="dataurl">dataurl</h2>
<p>Returns the <a href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs" target="_blank" rel="noopener noreferrer">data URL</a> of an asset.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|dataurl }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(image_path)|dataurl }}</span></code></pre>]]>
    </content>
  </entry>
</feed>
