<?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/</id>
  <title>Cecil - Documentation</title>
  <subtitle><![CDATA[Cecil is a command-line PHP application that merges Markdown pages, media and Twig templates to generate a static website.]]></subtitle>
  <link href="https://cecil.app/documentation/atom.xml" rel="self" type="application/atom+xml" />
  <link href="https://cecil.app/documentation/" rel="alternate" type="text/html" />
  <updated>2026-11-18T20:40:14+00:00</updated>
  <author>
    <name>Cecil</name>
    <uri>https://cecil.app</uri>
  </author>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/commands/new-extension/</id>
    <title>new:extension</title>
    <published>2026-10-26T00:00:00+00:00</published>
    <updated>2026-10-26T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/commands/new-extension/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>new:extension</h1>
<p>Creates the skeleton of an <a href="/developers/extend/">extension</a> class in the <code translate="no">extensions</code> directory, and displays the configuration to enable it.</p>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Creates a new extension

Usage:
  new:extension [options] [--] [&lt;path&gt;]

Arguments:
  path                       Use the given path as working directory

Options:
  -t, --type=TYPE            Extension type (generator, twig, postprocessor, subscriber, plugin)
      --name=NAME            Extension class name (e.g.: "MyGenerator")
      --namespace=NAMESPACE  Root namespace of the extension (e.g.: "MySite")
  -f, --force                Override the file if already exist
  -h, --help                 Display help for the given command. When no command is given display help for the list command
      --silent               Do not output any message
  -q, --quiet                Only errors are displayed. All other output is suppressed
  -V, --version              Display this application version
      --ansi|--no-ansi       Force (or disable --no-ansi) ANSI output
  -n, --no-interaction       Do not ask any interactive question
  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The new:extension command creates the skeleton of an extension class in the extensions directory,
  and displays the configuration to enable it.
  If you run this command without any options, it will ask you for the extension type, name and namespace.

    cecil.phar new:extension
    cecil.phar new:extension --type=generator --name=Database --namespace=MySite

  Available types: generator, twig, postprocessor, subscriber and plugin.

  To override an existing extension, run:

    cecil.phar new:extension --force</code></pre>
<h2 id="types">Types<a class="heading-anchor" href="#types" aria-hidden="true" tabindex="-1"></a></h2>
<table>
<thead>
<tr>
<th>Type</th>
<th>Class</th>
<th>Configuration</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">generator</code></td>
<td><code translate="no">&lt;namespace&gt;\Generator\&lt;name&gt;</code> (page generator)</td>
<td><code translate="no">pages.generators</code></td>
</tr>
<tr>
<td><code translate="no">twig</code></td>
<td><code translate="no">&lt;namespace&gt;\Twig\&lt;name&gt;</code> (Twig extension)</td>
<td><code translate="no">layouts.extensions</code></td>
</tr>
<tr>
<td><code translate="no">postprocessor</code></td>
<td><code translate="no">&lt;namespace&gt;\PostProcessor\&lt;name&gt;</code> (output post-processor)</td>
<td><code translate="no">output.postprocessors</code></td>
</tr>
<tr>
<td><code translate="no">subscriber</code></td>
<td><code translate="no">&lt;namespace&gt;\Subscriber\&lt;name&gt;</code> (build events subscriber)</td>
<td><code translate="no">extensions.subscribers</code></td>
</tr>
<tr>
<td><code translate="no">plugin</code></td>
<td><code translate="no">&lt;namespace&gt;\&lt;name&gt;</code> (plugin)</td>
<td><code translate="no">extensions.plugins</code></td>
</tr>
</tbody>
</table>
<p>The class is created in <code translate="no">extensions/&lt;namespace path&gt;/</code>. The <code translate="no">Cecil</code> namespace is reserved and can't be used.</p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/ai/agent-skills/</id>
    <title>Agent skills</title>
    <published>2026-10-22T00:00:00+00:00</published>
    <updated>2026-10-27T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/ai/agent-skills/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Agent skills</h1>
<p>Cecil provides <a href="https://agentskills.io" target="_blank" rel="noopener noreferrer">agent skills</a>: instructions that AI coding agents (Claude Code, GitHub Copilot, Cursor, etc.) load to work with Cecil the right way, following its conventions.</p>
<table>
<thead>
<tr>
<th>Skill</th>
<th>Use it to</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/Cecilapp/Cecil/blob/main/skills/cecil/SKILL.md" target="_blank" rel="noopener noreferrer"><code translate="no">cecil</code></a></td>
<td>Create, configure, build and deploy a site: content, front matter, templates, assets, configuration, etc.</td>
</tr>
<tr>
<td><a href="https://github.com/Cecilapp/Cecil/blob/main/skills/cecil-theme/SKILL.md" target="_blank" rel="noopener noreferrer"><code translate="no">cecil-theme</code></a></td>
<td>Create, structure and package a theme (visual theme or component theme) for Composer.</td>
</tr>
</tbody>
</table>
<h2 id="install">Install<a class="heading-anchor" href="#install" aria-hidden="true" tabindex="-1"></a></h2>
<p>Install the skills in your project with <a href="https://www.skills.sh" target="_blank" rel="noopener noreferrer"><code translate="no">npx skills</code></a>, which detects your coding agents and adds the skills where they expect them:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">npx skills add cecilapp/cecil</code></pre>
<h3 id="claude-code-plugin">Claude Code plugin<a class="heading-anchor" href="#claude-code-plugin" aria-hidden="true" tabindex="-1"></a></h3>
<p>With <a href="https://code.claude.com" target="_blank" rel="noopener noreferrer">Claude Code</a>, you can also install the skills as a plugin, from the <a href="https://github.com/Cecilapp/claude-plugins" target="_blank" rel="noopener noreferrer">Cecil marketplace</a>:</p>
<pre data-lang="text"><code class="language-text" translate="no">/plugin marketplace add Cecilapp/claude-plugins
/plugin install cecil@cecil</code></pre>
<p>The plugin fetches only the skills from the Cecil repository and keeps them up to date. They are then also available as <code translate="no">/cecil:cecil</code> and <code translate="no">/cecil:cecil-theme</code>.</p>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<p>Once installed, ask your agent to create, build, configure or deploy a Cecil site, or to create a theme: it uses the matching skill automatically.</p>
<p><em>Examples of prompts:</em></p>
<ul>
<li>“Create a Cecil blog with an English and a French version.”</li>
<li>“Add a <code translate="no">projects</code> section with a list of cards on the homepage.”</li>
<li>“Turn the layouts of this site into a reusable Cecil theme.”</li>
</ul>
<aside class="note note-tip"><p>Skills are updated with Cecil: reinstall them after upgrading Cecil to get the latest instructions (the Claude Code plugin is updated automatically).</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/ai/llms/</id>
    <title>Content for LLMs</title>
    <published>2026-10-22T00:00:00+00:00</published>
    <updated>2026-10-23T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/ai/llms/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Content for LLMs</h1>
<p>Language models read Markdown more easily than HTML. Cecil provides two <a href="/configuration/output/#default-formats">output formats</a> for them:</p>
<ul>
<li><code translate="no">llms</code>: a <a href="https://llmstxt.org" target="_blank" rel="noopener noreferrer"><code translate="no">llms.txt</code></a> file, an index of the site;</li>
<li><code translate="no">markdown</code>: a Markdown version of each page.</li>
</ul>
<p>Both are disabled by default.</p>
<h2 id="llms-txt">llms.txt<a class="heading-anchor" href="#llms-txt" aria-hidden="true" tabindex="-1"></a></h2>
<p>Since version <ins>8.114.0</ins>, the <code translate="no">llms</code> format renders the homepage as a <code translate="no">llms.txt</code> file at the root of the site. It contains:</p>
<ul>
<li>the site title and description;</li>
<li>the links of the main menu (external URLs are ignored);</li>
<li>the top-level sections and their pages (sub-sections are nested), with their title and description.</li>
</ul>
<p>To enable it, add the format to the homepage:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">pagetypeformats:</span>
    <span class="hljs-attr">homepage:</span>
      <span class="hljs-attr">llms:</span> <span class="hljs-literal">true</span></code></pre>
<p>With the <a href="/configuration/site/#metatags">metatags</a> template, the HTML homepage references the file with a <code translate="no">&lt;link rel="describedby" type="text/markdown"&gt;</code> tag.</p>
<h3 id="http-headers">HTTP headers<a class="heading-anchor" href="#http-headers" aria-hidden="true" tabindex="-1"></a></h3>
<p>You can also advertise the file to crawlers and agents with HTTP headers, using the <a href="/configuration/server/#serverheaders"><code translate="no">server.headers</code></a> option:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">server:</span>
  <span class="hljs-attr">headers:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">/*</span>
      <span class="hljs-attr">headers:</span>
        <span class="hljs-comment"># LLMs</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">Link</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">'&lt;/llms.txt&gt;; rel="llms-txt"'</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">X-Llms-Txt</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">/llms.txt</span></code></pre>
<p>These headers are only applied by the local preview server. To deploy them, use the <a href="https://github.com/Cecilapp/theme-headers" target="_blank" rel="noopener noreferrer"><em>Headers</em> component theme</a>: it generates a <code translate="no">_headers</code> file (supported by Netlify, statichost and Cloudflare Pages) including the headers defined in <code translate="no">server.headers</code>.</p>
<h3 id="exclude-content">Exclude content<a class="heading-anchor" href="#exclude-content" aria-hidden="true" tabindex="-1"></a></h3>
<p>To exclude a page or a section (and its pages) from <code translate="no">llms.txt</code>, set <code translate="no">llms: false</code> in its front matter:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">title:</span> <span class="hljs-string">"Legal notice"</span>
<span class="hljs-attr">llms:</span> <span class="hljs-literal">false</span>
<span class="hljs-meta">---</span></code></pre>
<p>Unpublished and <a href="/content/front-matter/#excluded">excluded</a> sections are not listed.</p>
<h2 id="markdown-pages">Markdown pages<a class="heading-anchor" href="#markdown-pages" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">markdown</code> format renders a page as a Markdown file, next to its HTML version (e.g.: <code translate="no">blog/post-1.md</code> for <code translate="no">blog/post-1/index.html</code>). The file contains the title and the body of the page; a section lists its pages.</p>
<p>To render all pages and sections in Markdown:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">pagetypeformats:</span>
    <span class="hljs-attr">page:</span>
      <span class="hljs-attr">markdown:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">section:</span>
      <span class="hljs-attr">markdown:</span> <span class="hljs-literal">true</span></code></pre>
<p>Or for a single page, with the <a href="/content/front-matter/#output"><code translate="no">output</code></a> variable:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">output:</span> <span class="hljs-string">[html,</span> <span class="hljs-string">markdown]</span>
<span class="hljs-meta">---</span></code></pre>
<p>With the <a href="/configuration/site/#metatags">metatags</a> template, the HTML page references its Markdown version with a <code translate="no">&lt;link rel="alternate" type="text/markdown"&gt;</code> tag. The links of <code translate="no">llms.txt</code> point to the Markdown version of the pages when it exists.</p>
<h3 id="prevent-indexing">Prevent indexing<a class="heading-anchor" href="#prevent-indexing" aria-hidden="true" tabindex="-1"></a></h3>
<p>To prevent search engines from indexing the Markdown pages (duplicate content of the HTML pages), add a <code translate="no">X-Robots-Tag</code> HTTP header with the <a href="/configuration/server/#serverheaders"><code translate="no">server.headers</code></a> option:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">server:</span>
  <span class="hljs-attr">headers:</span>
    <span class="hljs-comment"># Markdown outputs</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">"/*.md"</span>
      <span class="hljs-attr">headers:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">X-Robots-Tag</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">noindex</span></code></pre>
<p>As for the <a href="#http-headers"><code translate="no">llms.txt</code> headers</a>, use the <a href="https://github.com/Cecilapp/theme-headers" target="_blank" rel="noopener noreferrer"><em>Headers</em> component theme</a> to deploy it.</p>
<h2 id="templates">Templates<a class="heading-anchor" href="#templates" aria-hidden="true" tabindex="-1"></a></h2>
<p>To customize these outputs, override the default templates in your <code translate="no">layouts</code> directory (see <a href="/templates/lookup-rules/">lookup rules</a>):</p>
<ul>
<li><code translate="no">home.llms.twig</code>: the <code translate="no">llms.txt</code> file;</li>
<li><code translate="no">page.markdown.twig</code>, <code translate="no">list.markdown.twig</code> and <code translate="no">home.markdown.twig</code>: the Markdown pages.</li>
</ul>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/ai/crawlers/</id>
    <title>AI crawlers</title>
    <published>2026-10-22T00:00:00+00:00</published>
    <updated>2026-10-22T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/ai/crawlers/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>AI crawlers</h1>
<p>Cecil generates a <code translate="no">robots.txt</code> file that allows all crawlers. To block AI crawlers (or some of them), add your own rules by creating a page with the <code translate="no">robots</code> path:</p>
<p><em>pages/robots.md</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">layout:</span> <span class="hljs-string">robots</span>
<span class="hljs-attr">output:</span> <span class="hljs-string">txt</span>
<span class="hljs-meta">---</span>
<span class="hljs-attr">User-agent:</span> <span class="hljs-string">GPTBot</span>
<span class="hljs-attr">Disallow:</span> <span class="hljs-string">/</span>

<span class="hljs-attr">User-agent:</span> <span class="hljs-string">ClaudeBot</span>
<span class="hljs-attr">Disallow:</span> <span class="hljs-string">/</span>

<span class="hljs-attr">User-agent:</span> <span class="hljs-string">Google-Extended</span>
<span class="hljs-attr">Disallow:</span> <span class="hljs-string">/</span></code></pre>
<p>The body of the page is appended to the default rules (see <a href="/configuration/pages/#pages-default">default pages</a>).</p>
<aside class="note note-info"><p><code translate="no">robots.txt</code> rules are directives: well-behaved crawlers follow them, but they don’t prevent access to your content.</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/getting-started/installation/</id>
    <title>Installation</title>
    <published>2026-10-05T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/getting-started/installation/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Installation</h1>
<p>Cecil is distributed as a single executable file, <code translate="no">cecil.phar</code>, which runs anywhere PHP is installed, and as <a href="#standalone-binary">standalone binaries</a> that don't require PHP.</p>
<h2 id="requirements">Requirements<a class="heading-anchor" href="#requirements" aria-hidden="true" tabindex="-1"></a></h2>
<ul>
<li><a href="https://www.php.net/manual/install.php" target="_blank" rel="noopener noreferrer">PHP</a> 8.3+</li>
<li>PHP extensions: <code translate="no">fileinfo</code>, <code translate="no">gd</code> and <code translate="no">mbstring</code></li>
</ul>
<p>Check your PHP version and loaded extensions:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php -v
php -m</code></pre>
<h3 id="optional-extensions">Optional extensions<a class="heading-anchor" href="#optional-extensions" aria-hidden="true" tabindex="-1"></a></h3>
<table>
<thead>
<tr>
<th>Extension</th>
<th>Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://www.php.net/manual/book.intl.php" target="_blank" rel="noopener noreferrer"><code translate="no">intl</code></a></td>
<td>Date <a href="/templates/localization/">localization</a> for locales other than <code translate="no">en</code> (otherwise optional, improves performance).</td>
</tr>
<tr>
<td><a href="https://www.php.net/manual/book.curl.php" target="_blank" rel="noopener noreferrer"><code translate="no">curl</code></a></td>
<td>Checking external links with the <a href="/commands/doctor/"><code translate="no">doctor:links</code></a> command.</td>
</tr>
<tr>
<td><a href="https://www.php.net/manual/book.imagick.php" target="_blank" rel="noopener noreferrer"><code translate="no">imagick</code></a></td>
<td>Image processing, preferred over GD when available.</td>
</tr>
<tr>
<td><a href="https://www.php.net/manual/book.ffi.php" target="_blank" rel="noopener noreferrer"><code translate="no">ffi</code></a></td>
<td>Image processing with <a href="https://www.libvips.org/" target="_blank" rel="noopener noreferrer">libvips</a> (requires <a href="#composer">Composer installation</a>).</td>
</tr>
</tbody>
</table>
<h2 id="download-the-phar">Download the PHAR<a class="heading-anchor" href="#download-the-phar" aria-hidden="true" tabindex="-1"></a></h2>
<p>Download <code translate="no">cecil.phar</code> from your terminal:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">curl -LO https://cecil.app/cecil.phar</code></pre>
<p>Then run it with PHP:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar --version</code></pre>
<aside class="note note-info"><p>You can also download a <a href="https://cecil.app/download/">specific version or the preview version</a>.</p></aside>
<h2 id="standalone-binary">Standalone binary<a class="heading-anchor" href="#standalone-binary" aria-hidden="true" tabindex="-1"></a></h2>
<p>If PHP is not installed, download the standalone binary for your platform from the <a href="https://github.com/Cecilapp/Cecil/releases/latest" target="_blank" rel="noopener noreferrer">latest GitHub release</a>. It embeds PHP and the required extensions.</p>
<table>
<thead>
<tr>
<th>Platform</th>
<th>File</th>
</tr>
</thead>
<tbody>
<tr>
<td>Linux x64</td>
<td><code translate="no">cecil-linux-x64</code></td>
</tr>
<tr>
<td>Linux ARM64</td>
<td><code translate="no">cecil-linux-arm64</code></td>
</tr>
<tr>
<td>macOS Intel</td>
<td><code translate="no">cecil-macos-x64</code></td>
</tr>
<tr>
<td>macOS Apple Silicon</td>
<td><code translate="no">cecil-macos-arm64</code></td>
</tr>
<tr>
<td>Windows x64</td>
<td><code translate="no">cecil-windows-x64.exe</code></td>
</tr>
</tbody>
</table>
<p>For example:</p>
<div class="note note-tabs" id="note-tabs-1">
  <section class="note-tab" id="note-tabs-1-1">
    <h4 id="linux">Linux</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">curl -Lo cecil https://github.com/Cecilapp/Cecil/releases/latest/download/cecil-linux-x64
chmod +x cecil
./cecil --version</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-1-2">
    <h4 id="macos">macOS</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">curl -Lo cecil https://github.com/Cecilapp/Cecil/releases/latest/download/cecil-macos-arm64
chmod +x cecil
xattr -d com.apple.quarantine cecil
./cecil --version</code></pre>
<p>Binaries are not signed: the <code translate="no">xattr</code> command removes the quarantine attribute before the first run.</p>
  </section>
  <section class="note-tab" id="note-tabs-1-3">
    <h4 id="windows">Windows</h4>
    <pre data-lang="powershell"><code class="language-powershell hljs powershell" translate="no">curl.exe <span class="hljs-literal">-Lo</span> cecil.exe https://github.com/Cecilapp/Cecil/releases/latest/download/cecil<span class="hljs-literal">-windows</span><span class="hljs-literal">-x64</span>.exe
.\cecil.exe -<span class="hljs-literal">-version</span></code></pre>
  </section>
</div>
<aside class="note note-info"><p>SHA-256 checksums are available in the <code translate="no">cecil-binaries.sha256</code> file of each release, and the build provenance can be verified with <code translate="no">gh attestation verify cecil --repo Cecilapp/Cecil</code>.</p></aside>
<aside class="note note-important"><p>The binary uses GD for image processing: Imagick and libvips are not available. The <code translate="no">self-update</code> command is not available either: download the binary again to update it.</p>
<p>The <code translate="no">serve</code> command relies on the PHP built-in web server, which the binary doesn't embed: it requires a local PHP executable. Without PHP, run the <code translate="no">build</code> command and serve the output directory with another web server.</p></aside>
<h2 id="install-globally">Install globally<a class="heading-anchor" href="#install-globally" aria-hidden="true" tabindex="-1"></a></h2>
<p>Installing Cecil globally allows you to run the <code translate="no">cecil</code> command from any directory, instead of <code translate="no">php cecil.phar</code>.</p>
<div class="note note-tabs" id="note-tabs-2">
  <section class="note-tab" id="note-tabs-2-1">
    <h4 id="linux-1">Linux</h4>
    <p>By moving the PHAR into a directory of your <code translate="no">PATH</code>:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">sudo mv cecil.phar /usr/<span class="hljs-built_in">local</span>/bin/cecil
sudo chmod +x /usr/<span class="hljs-built_in">local</span>/bin/cecil</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-2-2">
    <h4 id="macos-1">macOS</h4>
    <p>With <a href="https://brew.sh" target="_blank" rel="noopener noreferrer">Homebrew</a>:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">brew install cecilapp/tap/cecil</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-2-3">
    <h4 id="windows-1">Windows</h4>
    <p>With <a href="https://scoop.sh" target="_blank" rel="noopener noreferrer">Scoop</a>:</p>
<pre data-lang="powershell"><code class="language-powershell hljs powershell" translate="no">scoop install https://cecil.app/scoop/cecil.json</code></pre>
<p>Or manually:</p>
<ol>
<li>Move <code translate="no">cecil.phar</code> to a dedicated directory, such as <code translate="no">C:\bin</code></li>
<li>Rename it from <code translate="no">cecil.phar</code> to <code translate="no">cecil</code></li>
<li>Append <code translate="no">;C:\bin</code> to your <code translate="no">PATH</code> environment variable</li>
<li>Create a <a href="https://raw.githubusercontent.com/Cecilapp/Cecil/main/bin/cecil.bat" target="_blank" rel="noopener noreferrer">wrapping batch script</a> next to it</li>
</ol>
  </section>
  <section class="note-tab" id="note-tabs-2-4">
    <h4 id="phive">PHIVE</h4>
    <p>With <a href="https://phar.io" target="_blank" rel="noopener noreferrer">PHIVE</a> (The PHAR Installation and Verification Environment):</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">phive install cecil</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-2-5">
    <h4 id="composer">Composer</h4>
    <p>With <a href="https://getcomposer.org" target="_blank" rel="noopener noreferrer">Composer</a>:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">composer global require cecil/cecil</code></pre>
<aside class="note note-important"><p>Make sure Composer's global binaries directory is in your <code translate="no">PATH</code>. Run <code translate="no">composer global config bin-dir --absolute</code> to get it.</p></aside>
<aside class="note note-tip"><p>To use Cecil as a dependency of a PHP project, see <a href="/developers/library/">Library</a>.</p></aside>
  </section>
</div>
<h2 id="verify-the-installation">Verify the installation<a class="heading-anchor" href="#verify-the-installation" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">cecil --version</code></pre>
<p>Or, if Cecil is not installed globally:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar --version</code></pre>
<aside class="note note-info"><p>Run <code translate="no">cecil list</code> to display the <a href="/commands/">available commands</a>.</p></aside>
<h2 id="update">Update<a class="heading-anchor" href="#update" aria-hidden="true" tabindex="-1"></a></h2>
<p>Update Cecil to the latest version according to your installation method:</p>
<div class="note note-code-group" id="note-code-group-3">
  <section class="note-tab" id="note-code-group-3-1">
    <h4 id="phar">PHAR</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar self-update</code></pre>
  </section>
  <section class="note-tab" id="note-code-group-3-2">
    <h4 id="homebrew">Homebrew</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">brew upgrade cecilapp/tap/cecil</code></pre>
  </section>
  <section class="note-tab" id="note-code-group-3-3">
    <h4 id="scoop">Scoop</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">scoop update cecil</code></pre>
  </section>
  <section class="note-tab" id="note-code-group-3-4">
    <h4 id="phive-1">PHIVE</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">phive update cecil</code></pre>
  </section>
  <section class="note-tab" id="note-code-group-3-5">
    <h4 id="composer">Composer</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">composer global update cecil/cecil</code></pre>
  </section>
</div>
<p>The <a href="#standalone-binary">standalone binary</a> is updated by downloading it again.</p>
<p>The <code translate="no">self-update</code> command (alias <code translate="no">selfupdate</code>, PHAR only) also accepts the following options:</p>
<ul>
<li><code translate="no">--rollback</code>: reverts to the previously installed version</li>
<li><code translate="no">--stable</code>: forces an update to the latest stable version</li>
<li><code translate="no">--preview</code>: forces an update to the latest unstable version</li>
</ul>
<aside class="note note-info"><p>The changelog of each release is available on <a href="https://github.com/Cecilapp/Cecil/releases" target="_blank" rel="noopener noreferrer">GitHub</a>.</p></aside>
<h2 id="troubleshooting">Troubleshooting<a class="heading-anchor" href="#troubleshooting" aria-hidden="true" tabindex="-1"></a></h2>
<h3 id="command-not-found-cecil"><code translate="no">command not found: cecil</code><a class="heading-anchor" href="#command-not-found-cecil" aria-hidden="true" tabindex="-1"></a></h3>
<p>The installation directory is not in your <code translate="no">PATH</code>: add it, or run Cecil with <code translate="no">php cecil.phar</code> from the directory containing the PHAR.</p>
<h3 id="php-version-or-extension-error">PHP version or extension error<a class="heading-anchor" href="#php-version-or-extension-error" aria-hidden="true" tabindex="-1"></a></h3>
<p>Your PHP CLI may differ from the one you expect (several versions installed): check it with <code translate="no">php -v</code> and <code translate="no">php --ini</code>, then enable missing extensions in the loaded <code translate="no">php.ini</code> file.</p>
<h3 id="diagnose-a-website">Diagnose a website<a class="heading-anchor" href="#diagnose-a-website" aria-hidden="true" tabindex="-1"></a></h3>
<p>Once a website is created, run the <a href="/commands/doctor/"><code translate="no">doctor</code></a> command to diagnose its configuration.</p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/developers/architecture/</id>
    <title>Architecture</title>
    <published>2026-05-27T00:00:00+00:00</published>
    <updated>2026-10-26T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/developers/architecture/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Architecture</h1>
<p>This page gives an overview of Cecil’s build pipeline, its technical architecture and its key components.</p>
<h2 id="build-pipeline">Build pipeline<a class="heading-anchor" href="#build-pipeline" aria-hidden="true" tabindex="-1"></a></h2>
<h3 id="pipeline-overview">Pipeline overview<a class="heading-anchor" href="#pipeline-overview" aria-hidden="true" tabindex="-1"></a></h3>
<pre data-lang="mermaid"><code class="language-mermaid" translate="no">graph LR
    SRC["Sources\n(pages, data, assets,\nstatic, layouts, themes)"]
    CFG["Configuration"]
    EXTS["Extensions\n(plugins, events)"]
    BUILDER["Builder"]
    LOAD["Load\n(pages, data,\nstatic files)"]
    CONVERT["Create &amp; convert\n(pages, taxonomies)"]
    GENERATE["Generate\n(generators, menus)"]
    RENDER["Render\n(Twig)"]
    SAVE["Save &amp; optimize\n(pages, assets,\nstatic files)"]
    OUT["_site/"]

    CFG --&gt; BUILDER
    EXTS --&gt; BUILDER
    SRC --&gt; LOAD
    BUILDER --&gt; LOAD --&gt; CONVERT --&gt; GENERATE --&gt; RENDER --&gt; SAVE --&gt; OUT</code></pre>
<h3 id="detailed-pipeline">Detailed pipeline<a class="heading-anchor" href="#detailed-pipeline" aria-hidden="true" tabindex="-1"></a></h3>
<pre data-lang="mermaid"><code class="language-mermaid" translate="no">graph TD
    %% Entry
    CLI["bin/cecil\n(CLI entry point)"]
    APP["Application\n(Symfony Console)"]
    CMD["Commands\nbuild / serve / doctor\nnew:* / clear / cache:clear\nshow:* / util:* / ..."]

    CLI --&gt; APP --&gt; CMD

    %% Orchestrator
    BUILDER["Builder\n(Orchestrator)"]
    CONFIG["Configuration\n(plugins &lt; default.php\n&lt; themes &lt; cecil.yml\n&lt; env vars + CLI options)"]
    CMD --&gt; BUILDER
    CONFIG --&gt; BUILDER

    %% Extensions
    EXTN["Extensions\n(Autoloader + Loader:\nplugins, event subscribers,\ngenerators, Twig extensions,\npost-processors)"]
    EVENTS["Build events\n(build.*, step.*, page.*)"]
    BUILDER --&gt; EXTN
    EXTN -- "plugins config" --&gt; CONFIG
    BUILDER -. "dispatch" .-&gt; EVENTS
    EVENTS -. "notify subscribers" .-&gt; EXTN

    %% Pipeline
    subgraph PIPELINE["Build pipeline (steps)"]
        S1["1. Pages/Load\n(Finder → Markdown files)"]
        S2["2. Data/Load\n(data files)"]
        S3["3. StaticFiles/Load\n(if static.load is enabled)"]
        S4["4. Pages/Create\n(create Page objects)"]
        S5["5. Pages/Convert\n(front matter +\nMarkdown → HTML)"]
        S6["6. Taxonomies/Create\n(create taxonomies)"]
        S7["7. Pages/Generate\n(generators)"]
        S8["8. Menus/Create\n(create menus)"]
        S9["9. StaticFiles/Copy\n(copy static files)"]
        S10["10. Pages/Render\n(Twig rendering)"]
        S11["11. Pages/Save\n(save pages)"]
        S12["12. Assets/Save\n(save assets)"]
        S13["13-16. Optimize/Html, Css, Js, Images\n(if optimization is enabled)"]

        S1 --&gt; S2 --&gt; S3 --&gt; S4 --&gt; S5 --&gt; S6 --&gt; S7 --&gt; S8 --&gt; S9 --&gt; S10 --&gt; S11 --&gt; S12 --&gt; S13
    end

    BUILDER --&gt; PIPELINE

    %% Subsystems
    CONV["Converter\n(pages.converter, pages.body.parser:\nParsedown + highlighter)"]

    subgraph COLLECTIONS["Collections"]
        PC["PagesCollection\n(Page objects)"]
        TC["TaxonomiesCollection\n(vocabularies/terms)"]
        MC["MenusCollection"]
    end

    subgraph GENERATORS["Generators (by priority)"]
        G1["DefaultPages\n(index, 404, robots, sitemap, xsl)"]
        G3["ExternalBody"]
        G4["Section"]
        G5["Taxonomy"]
        G6["Homepage"]
        G7["Pagination"]
        G8["Alias"]
        G9["Redirect"]
        G10["Custom generators\n(priority 100 by default)"]
        G1 --&gt; G3 --&gt; G4 --&gt; G5 --&gt; G6 --&gt; G7 --&gt; G8 --&gt; G9 --&gt; G10
    end

    subgraph RENDERER["Twig rendering"]
        TW["Twig engine"]
        EXT["Twig extensions\n(Core, Content, Collection,\nTranslation, Intl, Components\n+ custom)"]
        PP["PostProcessors\n(generator meta tag, excerpts, links\n+ custom)"]
        TH["Themes / Layouts"]
        TW --&gt; EXT
        TW --&gt; PP
        TH --&gt; TW
    end

    subgraph ASSETS["Assets"]
        AL["Asset locator"]
        AC["Compiler\n(SCSS → CSS)"]
        AI["Image processor\n(resize, responsive, WebP, AVIF)"]
        AO["Optimizer\n(CSS/JS minification,\nimage optimization)"]
    end

    CACHE[".cache/\n(assets, templates, translations)"]

    subgraph OUTPUT["Output (_site/)"]
        HTML["pages (HTML, XML, JSON, etc.)"]
        CSS2["CSS/JS assets"]
        IMG["images"]
        SF["static files"]
    end

    S5 --&gt; CONV
    S4 --&gt; PC
    S6 --&gt; TC
    S8 --&gt; MC
    S7 --&gt; GENERATORS
    GENERATORS --&gt; PC
    S10 --&gt; RENDERER
    EXTN --&gt; GENERATORS
    EXTN --&gt; EXT
    EXTN --&gt; PP
    PIPELINE -. "step.*, page.*" .-&gt; EVENTS

    PC --&gt; RENDERER
    TC --&gt; RENDERER
    MC --&gt; RENDERER
    S2 -- "site.data" --&gt; RENDERER
    S3 -- "site.static" --&gt; RENDERER

    %% assets are created by the converter (Markdown images, links) and by templates (asset() function),
    %% processed and stored in cache, then copied to the output
    CONV --&gt; ASSETS
    EXT --&gt; ASSETS
    ASSETS --&gt; CACHE
    CACHE --&gt; S12

    RENDERER --&gt; S11
    S11 --&gt; HTML
    S12 --&gt; CSS2
    S12 --&gt; IMG
    S9 --&gt; SF
    S13 -. "optimize files in place" .-&gt; OUTPUT

    %% Inputs
    subgraph INPUT["Sources"]
        MD["pages/\n(Markdown + front matter)"]
        DATA["data/\n(YAML, JSON, XML, CSV)"]
        STATIC["static/"]
        ASSETSDIR["assets/"]
        LAYOUTS["layouts/\n(Twig templates)"]
        TRANS["translations/"]
        THEMES["themes/\n(config, layouts, assets,\nstatic, data, translations,\nextensions)"]
        EXTDIR["extensions/\n(PHP classes)"]
    end

    MD --&gt; S1
    DATA --&gt; S2
    STATIC --&gt; S3
    STATIC --&gt; S9
    ASSETSDIR --&gt; AL
    LAYOUTS --&gt; TH
    TRANS --&gt; EXT
    THEMES --&gt; CONFIG
    THEMES --&gt; TH
    THEMES --&gt; EXTN
    EXTDIR --&gt; EXTN</code></pre>
<h2 id="technical-architecture">Technical architecture<a class="heading-anchor" href="#technical-architecture" aria-hidden="true" tabindex="-1"></a></h2>
<p>The diagrams below show how the code is organized in layers, from the command line to the file system, and which libraries each component relies on.</p>
<h3 id="architecture-overview">Architecture overview<a class="heading-anchor" href="#architecture-overview" aria-hidden="true" tabindex="-1"></a></h3>
<pre data-lang="mermaid"><code class="language-mermaid" translate="no">graph TB
    ENTRY["Entry points\n(bin/cecil, cecil.phar)"]
    CONSOLE["Console\n(commands)"]
    DEV["Local server\n(serve, live reload)"]
    CORE["Core\n(Builder, Config, Steps,\nCollections, Generators)"]
    EXTS["Extensions\n(plugins, events)"]
    SERVICES["Services\n(Converter, Renderer,\nAssets, Cache, Doctor)"]
    LIBS["Libraries\n(Symfony, Twig, Parsedown,\nscssphp, Intervention Image, ...)"]
    FS["File system\n(sources, .cache/, _site/)"]

    ENTRY --&gt; CONSOLE --&gt; CORE
    CONSOLE --&gt; DEV --&gt; CORE
    CORE &lt;--&gt; EXTS
    CORE --&gt; SERVICES
    CORE --&gt; FS
    SERVICES --&gt; FS
    SERVICES --&gt; LIBS</code></pre>
<h3 id="detailed-architecture">Detailed architecture<a class="heading-anchor" href="#detailed-architecture" aria-hidden="true" tabindex="-1"></a></h3>
<pre data-lang="mermaid"><code class="language-mermaid" translate="no">graph TB
    %% Distribution and entry points
    subgraph ENTRY["Entry points"]
        BIN["bin/cecil\n(Composer)"]
        PHAR["cecil.phar\n(Box, self-update)"]
    end

    subgraph CONSOLE["Console layer (Symfony Console)"]
        APP["Application"]
        ENV[".env\n(phpdotenv)"]
        BUILD["build"]
        SERVE["serve"]
        DOCTOR["doctor:*"]
        OTHERS["new:* / show:* / clear / cache:clear / util:*"]
        APP --&gt; BUILD
        APP --&gt; SERVE
        APP --&gt; DOCTOR
        APP --&gt; OTHERS
        ENV --&gt; APP
    end

    BIN --&gt; APP
    PHAR --&gt; APP

    subgraph DEV["Local server (serve)"]
        PHPS["PHP built-in server\n(.cecil/router.php)"]
        WATCH["FileWatcher\n(changes.flag)"]
        PROC["Build sub-process\n(Symfony Process)"]
        LR["livereload.js\n(Server-Sent Events)"]
        WATCH -- "rebuild" --&gt; PROC
        WATCH -- "notify" --&gt; PHPS
        PHPS --&gt; LR
    end

    SERVE --&gt; DEV

    subgraph CORE["Core"]
        BUILDER["Builder\n(steps orchestration, metrics)"]
        CFG["Config\n(Merger, Deprecations,\nnette/schema)"]
        LOG["Logger\n(PSR-3: Console, Progress, Print)"]
        STEPS["Steps\n(StepInterface)"]
        COLL["Collections\n(Page, Taxonomy, Menu)"]
        GEN["Generators\n(GeneratorManager)"]
        BUILDER --&gt; CFG
        BUILDER --&gt; LOG
        BUILDER --&gt; STEPS
        STEPS --&gt; COLL
        STEPS --&gt; GEN
    end

    BUILD --&gt; BUILDER
    PROC --&gt; BUILDER
    OTHERS --&gt; BUILDER

    subgraph EXTS["Extensions"]
        AUTO["Autoloader\n(extensions/, PSR-4,\nextensions/vendor/)"]
        LOADER["Loader\n(by name and priority,\nextensions.strict)"]
        PLUG["Plugins\n(Registry)"]
        EVT["Event dispatcher\n(BuildEvents, subscribers)"]
        PLUG --&gt; LOADER
    end

    BUILDER --&gt; AUTO
    BUILDER --&gt; PLUG
    PLUG -- "default config" --&gt; CFG
    BUILDER -- "dispatch" --&gt; EVT
    STEPS -- "dispatch" --&gt; EVT
    LOADER --&gt; GEN

    subgraph SERVICES["Services"]
        CONV["Converter\n(ConverterInterface, Parsedown Extra + TOC,\nhighlight.php / Tempest)"]
        REND["Renderer\n(Twig, Symfony Translation,\nTwig Components)"]
        ASSET["Asset\n(Locator, Compiler, Image, Optimizer)"]
        CACHE["Cache\n(PSR-16, files)"]
        DOC["Doctor\n(Site, Frontmatter, Links, SEO)"]
    end

    STEPS --&gt; CONV
    STEPS --&gt; REND
    STEPS --&gt; ASSET
    REND --&gt; ASSET
    CONV --&gt; ASSET
    ASSET --&gt; CACHE
    REND --&gt; CACHE
    DOCTOR --&gt; DOC
    DOC --&gt; BUILDER
    LOADER --&gt; REND

    subgraph LIBS["Main libraries"]
        L1["Symfony\n(Finder, Filesystem, Yaml, Serializer,\nValidator, DomCrawler, EventDispatcher)"]
        L2["scssphp"]
        L3["Intervention Image\n(GD, Imagick, libvips)"]
        L4["matthiasmullie/minify\nvoku/html-min"]
        L5["spatie/image-optimizer\n(external binaries)"]
        L6["yosymfony/toml"]
        L7["getID3, mp3info\n(audio/video metadata)"]
    end

    CORE --&gt; L1
    ASSET --&gt; L2
    ASSET --&gt; L3
    ASSET --&gt; L4
    STEPS --&gt; L4
    ASSET --&gt; L5
    CONV --&gt; L6
    ASSET --&gt; L7

    subgraph FS["File system"]
        SRC["Sources\n(pages/, data/, assets/, static/,\nlayouts/, translations/, themes/,\nextensions/)"]
        CACHEDIR[".cache/"]
        TMP[".cecil/\n(router, live reload, metrics, logs)"]
        OUT["_site/"]
    end

    STEPS -- "read" --&gt; SRC
    AUTO -- "read" --&gt; SRC
    CACHE --&gt; CACHEDIR
    STEPS -- "write" --&gt; OUT
    PHPS -- "serve" --&gt; OUT
    DEV --&gt; TMP</code></pre>
<h2 id="key-components">Key components<a class="heading-anchor" href="#key-components" aria-hidden="true" tabindex="-1"></a></h2>
<table>
<thead>
<tr>
<th>Component</th>
<th>Role</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Builder</strong></td>
<td>Central orchestrator that executes steps in sequence</td>
</tr>
<tr>
<td><strong>Config</strong></td>
<td>Merges plugins, default, themes and project configuration (<code translate="no">Config\Merger</code>), environment variables (<code translate="no">CECIL_*</code>) and CLI options, and reports deprecated options (<code translate="no">Config\Deprecations</code>)</td>
</tr>
<tr>
<td><strong>Steps</strong></td>
<td>Modular pipeline (16 steps), each with <code translate="no">init()</code> / <code translate="no">canProcess()</code> / <code translate="no">process()</code></td>
</tr>
<tr>
<td><strong>Collections</strong></td>
<td>Pages, Taxonomies, Menus: core data structures</td>
</tr>
<tr>
<td><strong>Converter</strong></td>
<td>Parses the front matter (YAML, INI, TOML or JSON) and converts Markdown to HTML (Parsedown, code highlighting); replaceable with <code translate="no">pages.converter</code> and <code translate="no">pages.body.parser</code></td>
</tr>
<tr>
<td><strong>Generators</strong></td>
<td>Create or update pages (default pages, sections, taxonomies, pagination, aliases, redirects, etc.)</td>
</tr>
<tr>
<td><strong>Extensions</strong></td>
<td>Generators, Twig extensions, post-processors, event subscribers and plugins declared by name, loaded and validated by <code translate="no">Extension\Loader</code>, autoloaded by <code translate="no">Extension\Autoloader</code></td>
</tr>
<tr>
<td><strong>Events</strong></td>
<td>Build events (<code translate="no">Event\BuildEvents</code>) dispatched around the build, each step and each page lifecycle, to <a href="/documentation/extend/#build-events">extend Cecil</a></td>
</tr>
<tr>
<td><strong>Renderer (Twig)</strong></td>
<td>Applies templates + extensions + post-processors</td>
</tr>
<tr>
<td><strong>Assets</strong></td>
<td>Created from Markdown content and templates: compiles SCSS, minifies, resizes and converts images, fingerprints files</td>
</tr>
<tr>
<td><strong>Cache</strong></td>
<td>Stores processed assets, compiled templates and translations in <code translate="no">.cache/</code> to speed up subsequent builds</td>
</tr>
<tr>
<td><strong>Doctor</strong></td>
<td>Diagnoses the project: front matter, links, SEO, cache (<code translate="no">doctor</code> commands)</td>
</tr>
</tbody>
</table>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/developers/library/</id>
    <title>Library</title>
    <published>2023-12-13T00:00:00+00:00</published>
    <updated>2026-10-30T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/developers/library/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Library</h1>
<p>Cecil provides a simple PHP API to build your website.</p>
<p>You can read the <a href="https://cecil.app/documentation/library/api/namespaces/cecil.html">API documentation</a> for more details.</p>
<h2 id="installation">Installation<a class="heading-anchor" href="#installation" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">composer require cecil/cecil</code></pre>
<h3 id="libvips-support">libvips support<a class="heading-anchor" href="#libvips-support" aria-hidden="true" tabindex="-1"></a></h3>
<p>To process images with <a href="https://www.libvips.org/" target="_blank" rel="noopener noreferrer">libvips</a> (optional), install the libvips driver in your project:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">composer require intervention/image-driver-vips</code></pre>
<aside class="note note-important"><p>This driver requires <a href="https://www.libvips.org/install.html" target="_blank" rel="noopener noreferrer">libvips</a> installed on your system and the PHP <a href="https://www.php.net/manual/book.ffi.php" target="_blank" rel="noopener noreferrer">FFI</a> extension enabled.</p>
<p>Cecil uses <a href="https://www.php.net/manual/book.imagick.php" target="_blank" rel="noopener noreferrer">Imagick</a> when available, otherwise libvips (if installed), otherwise <a href="https://www.php.net/manual/book.image.php" target="_blank" rel="noopener noreferrer">GD</a>.</p></aside>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<h3 id="build">Build<a class="heading-anchor" href="#build" aria-hidden="true" tabindex="-1"></a></h3>
<p>Build a new website with a custom configuration:</p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>

<span class="hljs-keyword">require_once</span> <span class="hljs-string">'vendor/autoload.php'</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Builder</span>;

$config = [
    <span class="hljs-string">'title'</span>   =&gt; <span class="hljs-string">"My website"</span>,
    <span class="hljs-string">'baseurl'</span> =&gt; <span class="hljs-string">'https://domain.tld/'</span>,
];

Builder::create($config)
    -&gt;setSourceDir(<span class="hljs-keyword">__DIR__</span>)      <span class="hljs-comment">// directory of the website sources (current directory by default)</span>
    -&gt;setDestinationDir(<span class="hljs-keyword">__DIR__</span>) <span class="hljs-comment">// where the output directory (`_site`) is created (source directory by default)</span>
    -&gt;build([]);

exec(<span class="hljs-string">'php -S localhost:8000 -t _site'</span>); <span class="hljs-comment">// preview locally</span></code></pre>
<aside class="note note-info"><p><code translate="no">Builder::create()</code> accepts a PHP <code translate="no">array</code> or a <a href="https://github.com/Cecilapp/Cecil/blob/main/src/Config.php" target="_blank" rel="noopener noreferrer"><code translate="no">Cecil\Config</code></a> instance, and optionally a <a href="https://www.php-fig.org/psr/psr-3/" target="_blank" rel="noopener noreferrer">PSR-3</a> logger.</p></aside>
<p>The <code translate="no">build()</code> method accepts an array of options:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">drafts</code></td>
<td>Includes drafts.</td>
<td><code translate="no">false</code></td>
</tr>
<tr>
<td><code translate="no">dry-run</code></td>
<td>Builds without saving files.</td>
<td><code translate="no">false</code></td>
</tr>
<tr>
<td><code translate="no">page</code></td>
<td>Builds a specific page.</td>
<td><code translate="no">''</code></td>
</tr>
<tr>
<td><code translate="no">render-subset</code></td>
<td>Renders a named subset of pages.</td>
<td><code translate="no">''</code></td>
</tr>
</tbody>
</table>
<p>These options match the <a href="/commands/build/"><code translate="no">build</code></a> command options.</p>
<h3 id="markdown">Markdown<a class="heading-anchor" href="#markdown" aria-hidden="true" tabindex="-1"></a></h3>
<p>Convert Markdown to HTML like Cecil does (Markdown parser of the site, <a href="/configuration/pages/#pages-body"><code translate="no">pages.body</code></a> configuration, notes, code highlighting), without building the website: e.g. to preview a page while it is edited.</p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>

<span class="hljs-keyword">require_once</span> <span class="hljs-string">'vendor/autoload.php'</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Builder</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Converter</span>\<span class="hljs-title">ParserFactory</span>;

$builder = Builder::create(<span class="hljs-keyword">require</span> <span class="hljs-string">'config.php'</span>)-&gt;setSourceDir(<span class="hljs-keyword">__DIR__</span>);

$parser = ParserFactory::create($builder, [
    <span class="hljs-string">'language'</span>  =&gt; <span class="hljs-string">'en'</span>,
    <span class="hljs-string">'assets'</span>    =&gt; <span class="hljs-keyword">false</span>,
    <span class="hljs-string">'asset_url'</span> =&gt; fn (string $path): string =&gt; <span class="hljs-string">'http://localhost:8000'</span> . $path,
]);

<span class="hljs-keyword">echo</span> $parser-&gt;text(file_get_contents(<span class="hljs-string">'pages/index.md'</span>));</code></pre>
<p>The Markdown parser options:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">language</code></td>
<td>Language of the content.</td>
<td><code translate="no">null</code></td>
</tr>
<tr>
<td><code translate="no">selectors</code></td>
<td>Headings of the table of contents.</td>
<td><code translate="no">pages.body.toc</code></td>
</tr>
<tr>
<td><code translate="no">assets</code></td>
<td>Processes the files of the body (images, video and audio) as assets (located, resized, converted, copied): with <code translate="no">false</code>, they are kept as they are.</td>
<td><code translate="no">true</code></td>
</tr>
<tr>
<td><code translate="no">asset_url</code></td>
<td>With <code translate="no">assets</code> set to <code translate="no">false</code>, a callable returning the URL of a local file from its path in the body.</td>
<td><code translate="no">null</code></td>
</tr>
</tbody>
</table>
<aside class="note note-tip"><p>Without processing the files as assets, a missing image does not throw an exception, nothing is written to the cache, and remote images are not downloaded.</p></aside>
<h3 id="diagnostics">Diagnostics<a class="heading-anchor" href="#diagnostics" aria-hidden="true" tabindex="-1"></a></h3>
<p>You can also run doctor checks through dedicated domain services, without using CLI commands:</p>
<ul>
<li><code translate="no">Cecil\Doctor\SiteDoctor::diagnose()</code>: configuration and environment</li>
<li><code translate="no">Cecil\Doctor\FrontmatterDoctor::diagnose()</code>: front matter of pages</li>
<li><code translate="no">Cecil\Doctor\SeoDoctor::audit()</code>: SEO of rendered pages (runs a dry-run build)</li>
<li><code translate="no">Cecil\Doctor\LinksDoctor::audit()</code>: internal and external links</li>
</ul>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>

<span class="hljs-keyword">require_once</span> <span class="hljs-string">'vendor/autoload.php'</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Builder</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Doctor</span>\<span class="hljs-title">SeoDoctor</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Doctor</span>\<span class="hljs-title">SiteDoctor</span>;

$builder = Builder::create(<span class="hljs-keyword">require</span> <span class="hljs-string">'config.php'</span>)
    -&gt;setSourceDir(<span class="hljs-keyword">__DIR__</span>)
    -&gt;setDestinationDir(<span class="hljs-keyword">__DIR__</span>);

$siteDoctor = <span class="hljs-keyword">new</span> SiteDoctor();
$diagnosis = $siteDoctor-&gt;diagnose($builder, <span class="hljs-keyword">__DIR__</span>, [<span class="hljs-string">'cecil.yml'</span>]);

$seoDoctor = <span class="hljs-keyword">new</span> SeoDoctor();
$seoAudit = $seoDoctor-&gt;audit($builder, [
    <span class="hljs-string">'page'</span> =&gt; <span class="hljs-string">''</span>,
    <span class="hljs-string">'include_generated'</span> =&gt; <span class="hljs-keyword">false</span>,
]);

var_dump($diagnosis[<span class="hljs-string">'errors'</span>], $seoAudit[<span class="hljs-string">'summary'</span>]);</code></pre>]]>
    </content>
  </entry>
  <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-16T00: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>Configuration examples for image CDN providers (see the <a href="/configuration/assets/#assets-images-cdn"><code translate="no">assets.images.cdn</code></a> option).</p>
<aside class="note note-tip"><p>SVG images are sent to the CDN only if the provider supports them and <code translate="no">svg: true</code> is set; remote images are handled unless <code translate="no">remote: false</code> is set.</p></aside>
<h2 id="cloudinary">Cloudinary<a class="heading-anchor" href="#cloudinary" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="https://cloudinary.com" target="_blank" rel="noopener noreferrer">https://cloudinary.com</a></p>
<pre data-lang="yaml"><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<a class="heading-anchor" href="#cloudimage" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="https://www.cloudimage.io" target="_blank" rel="noopener noreferrer">https://www.cloudimage.io</a></p>
<pre data-lang="yaml"><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<a class="heading-anchor" href="#twicpics" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="https://www.twicpics.com" target="_blank" rel="noopener noreferrer">https://www.twicpics.com</a></p>
<pre data-lang="yaml"><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>In the TwicPics dashboard, set the <strong>Source URL</strong> to your website <code translate="no">baseurl</code>.</p>
<h2 id="imgix">imgix<a class="heading-anchor" href="#imgix" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="https://imgix.com" target="_blank" rel="noopener noreferrer">https://imgix.com</a></p>
<pre data-lang="yaml"><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>In the imgix dashboard, set the <strong>Base URL</strong> of the source to your website <code translate="no">baseurl</code>.</p>
<h2 id="netlify-image-cdn">Netlify Image CDN<a class="heading-anchor" href="#netlify-image-cdn" aria-hidden="true" tabindex="-1"></a></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 data-lang="yaml"><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<a class="heading-anchor" href="#run-locally" aria-hidden="true" tabindex="-1"></a></h3>
<div class="note note-steps" id="note-steps-1">
  <ol class="note-steps-list">
    <li class="note-step">
      <h4 id="setup-netlify-cli">Setup Netlify CLI</h4>
      <pre data-lang="bash"><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 data-lang="toml"><code class="language-toml hljs ini" translate="no"><span class="hljs-section">[dev]</span>
  targetPort = 8000</code></pre>
    </li>
    <li class="note-step">
      <h4 id="run-local-server">Run local server</h4>
      <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar serve &amp; netlify dev</code></pre>
<p>On Windows, run <code translate="no">php cecil.phar serve</code> and <code translate="no">netlify dev</code> in two separate terminals.</p>
<p>Open <a href="http://localhost:8888" target="_blank" rel="noopener noreferrer">http://localhost:8888</a></p>
    </li>
  </ol>
</div>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/developers/extend/</id>
    <title>Extend Cecil</title>
    <published>2023-04-17T00:00:00+00:00</published>
    <updated>2026-10-30T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/developers/extend/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Extend Cecil</h1>
<p>Because Cecil is written in PHP, it's easy to extend its capabilities.</p>
<aside class="note note-tip"><p>Use the <a href="/commands/new-extension/"><code translate="no">new:extension</code></a> command to create the skeleton of an extension: <code translate="no">cecil new:extension --type=generator --name=Database --namespace=MySite</code>.</p></aside>
<h2 id="autoloading">Autoloading<a class="heading-anchor" href="#autoloading" aria-hidden="true" tabindex="-1"></a></h2>
<p>Custom classes are autoloaded from the <code translate="no">extensions</code> directory of your site (or of a theme), the file path matching the namespace: the class <code translate="no">MySite\Generator\MyGenerator</code> is loaded from <code translate="no">extensions/MySite/Generator/MyGenerator.php</code>.</p>
<p>To use another layout, declare <a href="https://www.php-fig.org/psr/psr-4/" target="_blank" rel="noopener noreferrer">PSR-4</a> mappings, relative to the site (or theme) directory:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">extensions:</span>
  <span class="hljs-attr">autoload:</span>
    <span class="hljs-string">'MySite\': src/ # `MySite\Generator\MyGenerator` is loaded from `src/Generator/MyGenerator.php`</span></code></pre>
<p>If your extensions depend on third-party libraries, install them with <a href="https://getcomposer.org" target="_blank" rel="noopener noreferrer">Composer</a> in the <code translate="no">extensions</code> directory (<code translate="no">composer require &lt;package&gt; --working-dir=extensions</code>): <code translate="no">extensions/vendor/autoload.php</code> is loaded automatically, even with the Cecil phar. Libraries already provided by Cecil are not overridden.</p>
<aside class="note note-important"><p>Use your own namespace (e.g.: <code translate="no">MySite\</code> or the name of your theme): the <code translate="no">Cecil\</code> namespace is reserved, and using it for custom classes is deprecated.</p></aside>
<h2 id="configuration">Configuration<a class="heading-anchor" href="#configuration" aria-hidden="true" tabindex="-1"></a></h2>
<p>Page generators, Twig extensions, output post-processors, <a href="#build-events">build events</a> subscribers and <a href="#plugins">plugins</a> are declared the same way, as a map indexed by name:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-string">&lt;key&gt;:</span>
  <span class="hljs-string">&lt;name&gt;:</span> <span class="hljs-string">&lt;class&gt;</span>                                         <span class="hljs-comment"># default priority (100)</span>
  <span class="hljs-string">&lt;name&gt;:</span> <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">&lt;class&gt;,</span> <span class="hljs-attr">priority:</span> <span class="hljs-string">&lt;int&gt;</span> <span class="hljs-string">}</span>             <span class="hljs-comment"># explicit priority</span>
  <span class="hljs-string">&lt;name&gt;:</span> <span class="hljs-literal">false</span>                                           <span class="hljs-comment"># disabled</span></code></pre>
<ul>
<li>Extensions run in ascending order of their priority; without a priority, they run after the built-in ones (priority <code translate="no">100</code>), in their declaration order.</li>
<li>A built-in extension can be disabled (<code translate="no">Redirect: false</code>) or moved (<code translate="no">Section: { priority: 45 }</code>) by its name.</li>
<li>An extension that cannot be loaded (unknown class, wrong interface, invalid option) is skipped and the error is logged. To fail the build instead, enable the strict mode (<code translate="no">false</code> only logs the error, without the Cecil 10 warning):</li>
</ul>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">extensions:</span>
  <span class="hljs-attr">strict:</span> <span class="hljs-literal">true</span></code></pre>
<aside class="note note-important"><p>Indexing extensions by priority (e.g.: <code translate="no">35: MySite\Generator\Database</code>) or by position (a list) is deprecated: it is still supported, with a warning, but will not be in Cecil 10. Use <code translate="no">Database: { class: MySite\Generator\Database, priority: 35 }</code> instead.</p>
<p>In Cecil 10, the strict mode will be enabled by default.</p></aside>
<h2 id="page-generators">Page generators<a class="heading-anchor" href="#page-generators" aria-hidden="true" tabindex="-1"></a></h2>
<p>A generator helps you create pages without Markdown files (for example, with data from an API or a database) or alter existing pages.</p>
<p>Create a new PHP class extending <code translate="no">Cecil\Generator\AbstractGenerator</code>, and add it to the <a href="/configuration/pages/#pages-generators"><code translate="no">pages.generators</code></a> list.</p>
<p>Built-in generators use the priorities <code translate="no">10</code> to <code translate="no">90</code>: choose the priority of your generator depending on the pages it needs (e.g.: after <code translate="no">Section</code> to access sections pages).</p>
<p>A generator adds pages to <code translate="no">$this-&gt;generatedPages</code> (a page with the ID of an existing page replaces it), and can remove existing pages with <code translate="no">$this-&gt;removePage('&lt;page-id&gt;')</code>.</p>
<p><strong>Example:</strong></p>
<p><em>/extensions/MySite/Generator/DummyPage.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MySite</span>\<span class="hljs-title">Generator</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Collection</span>\<span class="hljs-title">Page</span>\<span class="hljs-title">Page</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Collection</span>\<span class="hljs-title">Page</span>\<span class="hljs-title">Type</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Generator</span>\<span class="hljs-title">AbstractGenerator</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Generator</span>\<span class="hljs-title">GeneratorInterface</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DummyPage</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AbstractGenerator</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">GeneratorInterface</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">generate</span><span class="hljs-params">()</span>: <span class="hljs-title">void</span>
    </span>{
        <span class="hljs-comment">// create a new page $page, then add it to the site collection</span>
        $page = (<span class="hljs-keyword">new</span> Page(<span class="hljs-string">'my-page'</span>))
            -&gt;setType(Type::PAGE)
            -&gt;setPath(<span class="hljs-string">'mypage'</span>)
            -&gt;setBodyHtml(<span class="hljs-string">'&lt;p&gt;My page body&lt;/p&gt;'</span>)
            -&gt;setVariable(<span class="hljs-string">'language'</span>, <span class="hljs-string">'en'</span>)
            -&gt;setVariable(<span class="hljs-string">'title'</span>, <span class="hljs-string">'My page'</span>)
            -&gt;setVariable(<span class="hljs-string">'date'</span>, <span class="hljs-keyword">new</span> \DateTime())
            -&gt;setVariable(<span class="hljs-string">'menu'</span>, [<span class="hljs-string">'main'</span> =&gt; [<span class="hljs-string">'weight'</span> =&gt; <span class="hljs-number">99</span>]]);
        <span class="hljs-keyword">$this</span>-&gt;generatedPages-&gt;add($page);
    }
}</code></pre>
<p><em>/extensions/MySite/Generator/Database.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MySite</span>\<span class="hljs-title">Generator</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Collection</span>\<span class="hljs-title">Page</span>\<span class="hljs-title">Page</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Collection</span>\<span class="hljs-title">Page</span>\<span class="hljs-title">Type</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Generator</span>\<span class="hljs-title">AbstractGenerator</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Generator</span>\<span class="hljs-title">GeneratorInterface</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Database</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AbstractGenerator</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">GeneratorInterface</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">generate</span><span class="hljs-params">()</span>: <span class="hljs-title">void</span>
    </span>{
        <span class="hljs-comment">// create pages from a SQLite database</span>
        $db = <span class="hljs-keyword">new</span> \SQLite3(<span class="hljs-string">'database.sqlite'</span>);
        $statement = $db-&gt;prepare(<span class="hljs-string">'SELECT * FROM blog'</span>);
        $result = $statement-&gt;execute();
        <span class="hljs-keyword">while</span> ($row = $result-&gt;fetchArray(\SQLITE3_ASSOC)) {
            $page = (<span class="hljs-keyword">new</span> Page($row[<span class="hljs-string">'page-id'</span>]))
                -&gt;setType(Type::PAGE)
                -&gt;setPath($row[<span class="hljs-string">'path'</span>])
                -&gt;setBodyHtml($row[<span class="hljs-string">'html'</span>])
                -&gt;setVariable(<span class="hljs-string">'title'</span>, $row[<span class="hljs-string">'title'</span>])
                -&gt;setVariable(<span class="hljs-string">'date'</span>, $row[<span class="hljs-string">'date'</span>]);
            <span class="hljs-keyword">$this</span>-&gt;generatedPages-&gt;add($page);
        }
        $result-&gt;finalize();
        $db-&gt;close();
    }
}</code></pre>
<p><em>configuration</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">generators:</span>
    <span class="hljs-attr">DummyPage:</span> <span class="hljs-string">MySite\Generator\DummyPage</span>
    <span class="hljs-attr">Database:</span> <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">MySite\Generator\Database,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">35</span> <span class="hljs-string">}</span></code></pre>
<h2 id="twig-extension">Twig extension<a class="heading-anchor" href="#twig-extension" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can add custom <a href="/templates/reference/functions/">functions</a> and <a href="/templates/reference/filters/">filters</a>:</p>
<ol>
<li><a href="https://twig.symfony.com/doc/advanced.html#creating-an-extension" target="_blank" rel="noopener noreferrer">create a Twig extension</a></li>
<li>add the PHP file in the <code translate="no">extensions</code> directory (see <a href="#autoloading">Autoloading</a>)</li>
<li>add it to the <a href="/configuration/layouts/#layouts-extensions"><code translate="no">layouts.extensions</code></a> configuration</li>
</ol>
<p>The extension constructor receives the <code translate="no">Cecil\Builder</code> instance, which gives access to the configuration and the site content.</p>
<p><strong>Example:</strong></p>
<p><em>/extensions/MySite/Twig/MyTwigExtension.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MySite</span>\<span class="hljs-title">Twig</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyTwigExtension</span> <span class="hljs-keyword">extends</span> \<span class="hljs-title">Twig</span>\<span class="hljs-title">Extension</span>\<span class="hljs-title">AbstractExtension</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getFilters</span><span class="hljs-params">()</span>: <span class="hljs-title">array</span>
    </span>{
        <span class="hljs-comment">// add a new filter named 'md5'</span>
        <span class="hljs-keyword">return</span> [
            <span class="hljs-keyword">new</span> \Twig\TwigFilter(<span class="hljs-string">'md5'</span>, <span class="hljs-string">'md5'</span>),
        ];
    }
}</code></pre>
<p><em>configuration</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">extensions:</span>
    <span class="hljs-attr">MyExtension:</span> <span class="hljs-string">MySite\Twig\MyTwigExtension</span></code></pre>
<h2 id="output-post-processors">Output post-processors<a class="heading-anchor" href="#output-post-processors" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can post-process the rendered output of pages.</p>
<p>Create a new PHP class extending <code translate="no">Cecil\Renderer\PostProcessor\AbstractPostProcessor</code>, and add it to the <a href="/configuration/output/#output-postprocessors"><code translate="no">output.postprocessors</code></a> list.</p>
<p>Built-in post-processors (<code translate="no">GeneratorMetaTag</code>, <code translate="no">HtmlExcerpt</code> and <code translate="no">MarkdownLink</code>) use the priorities <code translate="no">10</code> to <code translate="no">30</code>, so they run first by default.</p>
<p><strong>Example:</strong></p>
<p><em>/extensions/MySite/PostProcessor/MyProcessor.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MySite</span>\<span class="hljs-title">PostProcessor</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Collection</span>\<span class="hljs-title">Page</span>\<span class="hljs-title">Page</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Renderer</span>\<span class="hljs-title">PostProcessor</span>\<span class="hljs-title">AbstractPostProcessor</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyProcessor</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AbstractPostProcessor</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">process</span><span class="hljs-params">(Page $page, string $output, string $format)</span>: <span class="hljs-title">string</span>
    </span>{
        <span class="hljs-comment">// add a meta tag to the head of the HTML output</span>
        <span class="hljs-keyword">if</span> ($format == <span class="hljs-string">'html'</span>) {
            <span class="hljs-keyword">if</span> (!preg_match(<span class="hljs-string">'/&lt;meta name="test".*/i'</span>, $output)) {
                $meta = <span class="hljs-string">'&lt;meta name="test" content="Test"&gt;'</span>;
                $output = preg_replace_callback(<span class="hljs-string">'/([[:blank:]]*)(&lt;\/head&gt;)/i'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">($matches)</span> <span class="hljs-title">use</span> <span class="hljs-params">($meta)</span> </span>{
                    <span class="hljs-keyword">return</span> str_repeat($matches[<span class="hljs-number">1</span>] ?: <span class="hljs-string">' '</span>, <span class="hljs-number">2</span>) . $meta . <span class="hljs-string">"\n"</span> . $matches[<span class="hljs-number">1</span>] . $matches[<span class="hljs-number">2</span>];
                }, $output);
            }
        }

        <span class="hljs-keyword">return</span> $output;
    }
}</code></pre>
<p><em>configuration</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">postprocessors:</span>
    <span class="hljs-attr">MyProcessor:</span> <span class="hljs-string">MySite\PostProcessor\MyProcessor</span></code></pre>
<h2 id="markdown-converter">Markdown converter<a class="heading-anchor" href="#markdown-converter" aria-hidden="true" tabindex="-1"></a></h2>
<p>The front matter and the Markdown body of pages are converted by the class defined in <a href="/configuration/pages/#pages-converter"><code translate="no">pages.converter</code></a>. It is also used by the <code translate="no">markdown_to_html</code> filter and for external pages (the <code translate="no">toc</code> filter uses the <a href="#markdown-parser">Markdown parser</a> directly).</p>
<p>To change the conversion, create a PHP class implementing <code translate="no">Cecil\Converter\ConverterInterface</code> (its constructor receives the <code translate="no">Cecil\Builder</code> instance), or extending the default <code translate="no">Cecil\Converter\Converter</code> class.</p>
<p><strong>Example:</strong></p>
<p><em>/extensions/MySite/Converter.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MySite</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Converter</span> <span class="hljs-keyword">extends</span> \<span class="hljs-title">Cecil</span>\<span class="hljs-title">Converter</span>\<span class="hljs-title">Converter</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">convertBody</span><span class="hljs-params">(string $string, ?string $language = null)</span>: <span class="hljs-title">string</span>
    </span>{
        <span class="hljs-comment">// replaces `[[page-id]]` with a link, before the default conversion</span>
        $string = preg_replace(<span class="hljs-string">'/\[\[([a-z0-9-\/]+)\]\]/'</span>, <span class="hljs-string">'[$1]($1.md)'</span>, $string);

        <span class="hljs-keyword">return</span> <span class="hljs-keyword">parent</span>::convertBody($string, $language);
    }
}</code></pre>
<p><em>configuration</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">converter:</span> <span class="hljs-string">MySite\Converter</span></code></pre>
<h2 id="markdown-parser">Markdown parser<a class="heading-anchor" href="#markdown-parser" aria-hidden="true" tabindex="-1"></a></h2>
<p>To add your own Markdown syntax, replace the Markdown parser used by the default converter (and by the <code translate="no">markdown_to_html</code> and <code translate="no">toc</code> filters) with the <a href="/configuration/pages/#pages-body-parser"><code translate="no">pages.body.parser</code></a> option.</p>
<p>Create a PHP class extending <code translate="no">Cecil\Converter\Parsedown</code>, based on <a href="https://github.com/erusev/parsedown" target="_blank" rel="noopener noreferrer">Parsedown</a> (1.x) and <a href="https://github.com/erusev/parsedown-extra" target="_blank" rel="noopener noreferrer">Parsedown Extra</a>, and register your syntax with its extension mechanism: a marker character in <code translate="no">$this-&gt;InlineTypes</code> (or <code translate="no">$this-&gt;BlockTypes</code>) refers to an <code translate="no">inline&lt;Type&gt;()</code> method (or <code translate="no">block&lt;Type&gt;()</code>, <code translate="no">block&lt;Type&gt;Continue()</code> and <code translate="no">block&lt;Type&gt;Complete()</code> methods).</p>
<aside class="note note-warning"><p>A custom parser relies on Parsedown internals: it may need to be updated when Cecil upgrades Parsedown.</p></aside>
<p>The parser can also be created outside of a build (see <a href="/documentation/library/#markdown">Library</a>): pass the options to the parent constructor, and do not rely on the state of a build (e.g. the pages collection).</p>
<p><strong>Example:</strong></p>
<p><em>/extensions/MySite/Parsedown.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MySite</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Builder</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Parsedown</span> <span class="hljs-keyword">extends</span> \<span class="hljs-title">Cecil</span>\<span class="hljs-title">Converter</span>\<span class="hljs-title">Parsedown</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">__construct</span><span class="hljs-params">(Builder $builder, ?array $options = null)</span>
    </span>{
        <span class="hljs-keyword">parent</span>::__construct($builder, $options);
        <span class="hljs-comment">// `==text==` → `&lt;mark&gt;text&lt;/mark&gt;`</span>
        <span class="hljs-keyword">$this</span>-&gt;InlineTypes[<span class="hljs-string">'='</span>][] = <span class="hljs-string">'Mark'</span>;
        <span class="hljs-keyword">$this</span>-&gt;inlineMarkerList .= <span class="hljs-string">'='</span>;
    }

    <span class="hljs-keyword">protected</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">inlineMark</span><span class="hljs-params">($Excerpt)</span>
    </span>{
        <span class="hljs-keyword">if</span> (preg_match(<span class="hljs-string">'/^==(?=\S)(.+?)(?&lt;=\S)==/'</span>, $Excerpt[<span class="hljs-string">'text'</span>], $matches)) {
            <span class="hljs-keyword">return</span> [
                <span class="hljs-string">'extent'</span>  =&gt; \strlen($matches[<span class="hljs-number">0</span>]),
                <span class="hljs-string">'element'</span> =&gt; [<span class="hljs-string">'name'</span> =&gt; <span class="hljs-string">'mark'</span>, <span class="hljs-string">'text'</span> =&gt; $matches[<span class="hljs-number">1</span>], <span class="hljs-string">'handler'</span> =&gt; <span class="hljs-string">'line'</span>],
            ];
        }

        <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
    }
}</code></pre>
<p><em>configuration</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">parser:</span> <span class="hljs-string">MySite\Parsedown</span></code></pre>
<h2 id="build-events">Build events<a class="heading-anchor" href="#build-events" aria-hidden="true" tabindex="-1"></a></h2>
<p>Events are dispatched during the build: listen to them to run your own code before or after the build, each step, or at each step of the life cycle of a page (e.g.: to create a search index, notify a service, or modify the output of pages).</p>
<table>
<thead>
<tr>
<th>Event</th>
<th>Constant</th>
<th>When</th>
<th>Event class</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">build.start</code></td>
<td><code translate="no">BuildEvents::BUILD_START</code></td>
<td>before the first step</td>
<td><code translate="no">BuildEvent</code></td>
</tr>
<tr>
<td><code translate="no">build.finished</code></td>
<td><code translate="no">BuildEvents::BUILD_FINISHED</code></td>
<td>after the last step</td>
<td><code translate="no">BuildEvent</code></td>
</tr>
<tr>
<td><code translate="no">step.pre</code></td>
<td><code translate="no">BuildEvents::STEP_PRE</code></td>
<td>before each step</td>
<td><code translate="no">StepEvent</code></td>
</tr>
<tr>
<td><code translate="no">step.post</code></td>
<td><code translate="no">BuildEvents::STEP_POST</code></td>
<td>after each step</td>
<td><code translate="no">StepEvent</code></td>
</tr>
<tr>
<td><code translate="no">page.created</code></td>
<td><code translate="no">BuildEvents::PAGE_CREATED</code></td>
<td>after a page is created from a content file</td>
<td><code translate="no">PageEvent</code></td>
</tr>
<tr>
<td><code translate="no">page.converted</code></td>
<td><code translate="no">BuildEvents::PAGE_CONVERTED</code></td>
<td>after a published page is converted (front matter and body)</td>
<td><code translate="no">PageEvent</code></td>
</tr>
<tr>
<td><code translate="no">page.rendered</code></td>
<td><code translate="no">BuildEvents::PAGE_RENDERED</code></td>
<td>after a page is rendered in a format (after post-processors)</td>
<td><code translate="no">PageRenderedEvent</code></td>
</tr>
<tr>
<td><code translate="no">page.saved</code></td>
<td><code translate="no">BuildEvents::PAGE_SAVED</code></td>
<td>after a rendered page is saved to a file</td>
<td><code translate="no">PageSavedEvent</code></td>
</tr>
</tbody>
</table>
<p>Every event gives access to the build context (<code translate="no">getBuilder()</code>) and options (<code translate="no">getOptions()</code>); <code translate="no">StepEvent</code> adds <code translate="no">getStep()</code>, <code translate="no">PageEvent</code> adds <code translate="no">getPage()</code>, <code translate="no">PageRenderedEvent</code> adds <code translate="no">getFormat()</code>, <code translate="no">getOutput()</code> and <code translate="no">setOutput()</code>, <code translate="no">PageSavedEvent</code> adds <code translate="no">getFormat()</code> and <code translate="no">getPathname()</code>.</p>
<p>Create an <a href="https://symfony.com/doc/current/components/event_dispatcher.html#using-event-subscribers" target="_blank" rel="noopener noreferrer">event subscriber</a> extending <code translate="no">Cecil\Event\AbstractSubscriber</code> (which gives access to <code translate="no">$this-&gt;builder</code> and <code translate="no">$this-&gt;config</code>), and add it to the <code translate="no">extensions.subscribers</code> list.</p>
<p><strong>Example:</strong></p>
<p><em>/extensions/MySite/SearchIndex.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">MySite</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Event</span>\<span class="hljs-title">AbstractSubscriber</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Event</span>\<span class="hljs-title">BuildEvent</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Event</span>\<span class="hljs-title">BuildEvents</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Event</span>\<span class="hljs-title">PageEvent</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SearchIndex</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AbstractSubscriber</span>
</span>{
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">array</span> $index = [];

    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getSubscribedEvents</span><span class="hljs-params">()</span>: <span class="hljs-title">array</span>
    </span>{
        <span class="hljs-keyword">return</span> [
            BuildEvents::PAGE_CONVERTED =&gt; <span class="hljs-string">'onPageConverted'</span>,
            BuildEvents::BUILD_FINISHED =&gt; <span class="hljs-string">'onBuildFinished'</span>,
        ];
    }

    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">onPageConverted</span><span class="hljs-params">(PageEvent $event)</span>: <span class="hljs-title">void</span>
    </span>{
        $page = $event-&gt;getPage();
        <span class="hljs-keyword">$this</span>-&gt;index[] = [<span class="hljs-string">'title'</span> =&gt; $page-&gt;getVariable(<span class="hljs-string">'title'</span>), <span class="hljs-string">'path'</span> =&gt; $page-&gt;getPath()];
    }

    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">onBuildFinished</span><span class="hljs-params">(BuildEvent $event)</span>: <span class="hljs-title">void</span>
    </span>{
        <span class="hljs-keyword">if</span> ($event-&gt;getOptions()[<span class="hljs-string">'dry-run'</span>]) {
            <span class="hljs-keyword">return</span>;
        }
        file_put_contents(<span class="hljs-keyword">$this</span>-&gt;config-&gt;getOutputPath() . <span class="hljs-string">'/search.json'</span>, json_encode(<span class="hljs-keyword">$this</span>-&gt;index));
    }
}</code></pre>
<p><em>configuration</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">extensions:</span>
  <span class="hljs-attr">subscribers:</span>
    <span class="hljs-attr">SearchIndex:</span> <span class="hljs-string">MySite\SearchIndex</span></code></pre>
<aside class="note note-tip"><p>When using Cecil as a <a href="/documentation/library/">PHP library</a>, listeners can also be added directly to the dispatcher before the build: <code translate="no">$builder-&gt;getEventDispatcher()-&gt;addListener(BuildEvents::PAGE_SAVED, $callable)</code>.</p></aside>
<h2 id="plugins">Plugins<a class="heading-anchor" href="#plugins" aria-hidden="true" tabindex="-1"></a></h2>
<p>A plugin is a single entry point that registers a set of extensions: generators, Twig extensions, post-processors, event subscribers and listeners, and default configuration. It's the recommended way to ship extensions with a theme: enabling the theme enables its plugin, with no other configuration.</p>
<p>Create a PHP class extending <code translate="no">Cecil\Plugin\AbstractPlugin</code> (which gives access to <code translate="no">$this-&gt;builder</code> and <code translate="no">$this-&gt;config</code>), and add it to the <code translate="no">extensions.plugins</code> list.</p>
<p><strong>Example:</strong></p>
<p><em>/themes/example/extensions/Example/ExamplePlugin.php</em></p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-keyword">namespace</span> <span class="hljs-title">Example</span>;

<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Event</span>\<span class="hljs-title">BuildEvents</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Plugin</span>\<span class="hljs-title">AbstractPlugin</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Cecil</span>\<span class="hljs-title">Plugin</span>\<span class="hljs-title">Registry</span>;

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ExamplePlugin</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AbstractPlugin</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">register</span><span class="hljs-params">(Registry $registry)</span>: <span class="hljs-title">void</span>
    </span>{
        $registry
            -&gt;config([<span class="hljs-string">'example'</span> =&gt; [<span class="hljs-string">'feed'</span> =&gt; [<span class="hljs-string">'limit'</span> =&gt; <span class="hljs-number">10</span>]]]) <span class="hljs-comment">// default options</span>
            -&gt;twigExtension(Twig\ExampleExtension::class)
            -&gt;generator(Generator\Feed::class, priority: <span class="hljs-number">35</span>)
            -&gt;postProcessor(PostProcessor\Minify::class)
            -&gt;subscriber(SearchIndex::class)
            -&gt;listen(BuildEvents::BUILD_FINISHED, fn () =&gt; <span class="hljs-keyword">$this</span>-&gt;builder-&gt;getLogger()-&gt;notice(<span class="hljs-string">'Example is ready'</span>));
    }
}</code></pre>
<p><em>/themes/example/config.yml</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">extensions:</span>
  <span class="hljs-attr">plugins:</span>
    <span class="hljs-attr">Example:</span> <span class="hljs-string">Example\ExamplePlugin</span></code></pre>
<p>Extensions registered by a plugin are named after their short class name (e.g.: <code translate="no">Feed</code>), unless a <code translate="no">name</code> is given, and use the default priority (<code translate="no">100</code>) unless a <code translate="no">priority</code> is given. The plugin configuration has the lowest precedence: the site (and themes) configuration can override its options, and disable (<code translate="no">Feed: false</code>) or move (<code translate="no">Feed: { priority: 45 }</code>) its extensions by name.</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-20T00: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>
<p>Cecil provides Twig functions and filters to resize, crop and convert images, and to generate responsive images and placeholders.</p>
<h2 id="image-srcset">image_srcset<a class="heading-anchor" href="#image-srcset" aria-hidden="true" tabindex="-1"></a></h2>
<p>Builds the HTML img <code translate="no">srcset</code> (responsive) attribute of an image asset.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_srcset(asset) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><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<a class="heading-anchor" href="#image-sizes" aria-hidden="true" tabindex="-1"></a></h2>
<p>Returns the HTML img <code translate="no">sizes</code> attribute based on a CSS class name (see <a href="/configuration/assets/#assets-images"><code translate="no">assets.images.responsive.sizes</code></a>).</p>
<p>It should be used in conjunction with the <a href="#image-srcset"><code translate="no">image_srcset</code></a> function (see the example above).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_sizes('class') }}</span></code></pre>
<h2 id="image-from-website">image_from_website<a class="heading-anchor" href="#image-from-website" aria-hidden="true" tabindex="-1"></a></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 data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_from_website('url', {attributes}, {options}) }}</span></code></pre>
<p>Candidates are searched in the page HTML in the following order; the first one 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="/configuration/cache/#cache-assets-remote-ttl"><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="/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 data-lang="twig"><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<a class="heading-anchor" href="#resize" aria-hidden="true" tabindex="-1"></a></h2>
<p>Resizes an image to a specified width (in pixels) and/or 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, then cropped and centered if necessary</li>
<li>If <code translate="no">remove_animation</code> is <code translate="no">true</code>, any animation in the image (e.g.: GIF) is removed</li>
</ul>
<pre data-lang="twig"><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: the resized version is saved at <code translate="no">/thumbnails/&lt;width&gt;x&lt;height&gt;/&lt;path&gt;</code> (prefixed by <a href="/configuration/assets/#assets-target"><code translate="no">assets.target</code></a> if set).</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 data-lang="twig"><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 200px height, width 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<a class="heading-anchor" href="#cover" aria-hidden="true" tabindex="-1"></a></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 data-lang="twig"><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 data-lang="twig"><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<a class="heading-anchor" href="#maskable" aria-hidden="true" tabindex="-1"></a></h2>
<p>Adds padding, as a percentage of the image size (<code translate="no">20</code> by default), to an image to make it maskable.</p>
<pre data-lang="twig"><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 data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('icon.png')|maskable }}</span></code></pre>
<h2 id="webp">webp<a class="heading-anchor" href="#webp" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts an image to <a href="https://developers.google.com/speed/webp" target="_blank" rel="noopener noreferrer">WebP</a> format, with an optional quality (default: <a href="/configuration/assets/#assets-images"><code translate="no">assets.images.quality</code></a>).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|webp(quality) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><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<a class="heading-anchor" href="#avif" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts an image to <a href="https://github.com/AOMediaCodec/libavif" target="_blank" rel="noopener noreferrer">AVIF</a> format, with an optional quality (default: <a href="/configuration/assets/#assets-images"><code translate="no">assets.images.quality</code></a>).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|avif(quality) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><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(60) }}</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>
<aside class="note note-info"><p>WebP and AVIF support depends on the image driver available (Imagick, libvips or GD). The <code translate="no">html</code> function skips alternative formats (<code translate="no">formats</code> option) not supported by the driver.</p></aside>
<h2 id="lqip">lqip<a class="heading-anchor" href="#lqip" aria-hidden="true" tabindex="-1"></a></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> (100 px wide, blurred) as data URL.</p>
<pre data-lang="twig"><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<a class="heading-anchor" href="#dominant-color" aria-hidden="true" tabindex="-1"></a></h2>
<p>Returns the dominant color of an image, as a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb" target="_blank" rel="noopener noreferrer">CSS color value</a> (e.g. <code translate="no">rgb(120 85 60)</code>).</p>
<pre data-lang="twig"><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/configuration/site/</id>
    <title>Site options</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-13T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/site/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Site options</h1>
<p>These options define the main settings of the site: title, URL, description, menus, taxonomies, theme, metatags, etc.</p>
<h2 id="title">title<a class="heading-anchor" href="#title" aria-hidden="true" tabindex="-1"></a></h2>
<p>Main title of the site.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">title:</span> <span class="hljs-string">"&lt;site title&gt;"</span></code></pre>
<h2 id="baseline">baseline<a class="heading-anchor" href="#baseline" aria-hidden="true" tabindex="-1"></a></h2>
<p>Short description (~ 20 characters).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">baseline:</span> <span class="hljs-string">"&lt;baseline&gt;"</span></code></pre>
<h2 id="baseurl">baseurl<a class="heading-anchor" href="#baseurl" aria-hidden="true" tabindex="-1"></a></h2>
<p>The base URL.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">baseurl:</span> <span class="hljs-string">&lt;url&gt;</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">baseurl:</span> <span class="hljs-string">http://localhost:8000/</span></code></pre>
<aside class="note note-important"><p><code translate="no">baseurl</code> should end with a trailing slash (<code translate="no">/</code>).</p></aside>
<h2 id="canonicalurl">canonicalurl<a class="heading-anchor" href="#canonicalurl" aria-hidden="true" tabindex="-1"></a></h2>
<p>If set to <code translate="no">true</code> the <a href="/templates/reference/functions/#url"><code translate="no">url()</code></a> function will return the absolute URL (<code translate="no">false</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">canonicalurl:</span> <span class="hljs-string">&lt;true|false&gt;</span> <span class="hljs-comment"># false by default</span></code></pre>
<h2 id="description">description<a class="heading-anchor" href="#description" aria-hidden="true" tabindex="-1"></a></h2>
<p>Site description (~ 250 characters).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">description:</span> <span class="hljs-string">"&lt;description&gt;"</span></code></pre>
<h2 id="menus">menus<a class="heading-anchor" href="#menus" aria-hidden="true" tabindex="-1"></a></h2>
<p>Menus are used to create <a href="/templates/variables/#site-menus">navigation links in templates</a>.</p>
<p>A menu is a list of entries, each defined by a unique ID and properties (name, URL, weight).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">menus:</span>
  <span class="hljs-string">&lt;name&gt;:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">&lt;unique-id&gt;</span>   <span class="hljs-comment"># unique identifier (required)</span>
      <span class="hljs-attr">name:</span> <span class="hljs-string">"&lt;name&gt;"</span>    <span class="hljs-comment"># name displayed in templates</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">&lt;url&gt;</span>        <span class="hljs-comment"># relative or absolute URL</span>
      <span class="hljs-attr">weight:</span> <span class="hljs-string">&lt;integer&gt;</span> <span class="hljs-comment"># integer value used to sort entries (lighter first)</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">menus:</span>
  <span class="hljs-attr">main:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">about</span>
      <span class="hljs-attr">name:</span> <span class="hljs-string">"About"</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">/about/</span>
      <span class="hljs-attr">weight:</span> <span class="hljs-number">1</span>
  <span class="hljs-attr">footer:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">author</span>
      <span class="hljs-attr">name:</span> <span class="hljs-string">The</span> <span class="hljs-string">author</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">https://arnaudligny.fr</span>
      <span class="hljs-attr">weight:</span> <span class="hljs-number">99</span></code></pre>
<aside class="note note-info"><p>A <code translate="no">main</code> menu is automatically created with the home page entry and the top-level sections entries, unless they define their own <code translate="no">menu</code> variable (see <a href="/content/">content management</a>).</p></aside>
<aside class="note note-tip"><p>A page can be added to a menu by setting the <a href="/content/front-matter/#menu"><code translate="no">menu</code> variable</a> in its front matter.</p></aside>
<h3 id="override-an-entry">Override an entry<a class="heading-anchor" href="#override-an-entry" aria-hidden="true" tabindex="-1"></a></h3>
<p>A page menu entry can be overridden: use the page ID as <code translate="no">id</code>.</p>
<p>The ID of a page menu entry doesn't include the language prefix (e.g.: <code translate="no">docs</code> for the <code translate="no">fr/docs</code> page): the same <code translate="no">id</code> targets the entry in every language.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">menus:</span>
  <span class="hljs-attr">main:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">index</span>
      <span class="hljs-attr">name:</span> <span class="hljs-string">"My amazing homepage!"</span>
      <span class="hljs-attr">weight:</span> <span class="hljs-number">1</span></code></pre>
<h3 id="disable-an-entry">Disable an entry<a class="heading-anchor" href="#disable-an-entry" aria-hidden="true" tabindex="-1"></a></h3>
<p>A menu entry can be disabled with <code translate="no">enabled: false</code>.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">menus:</span>
  <span class="hljs-attr">main:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">about</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">false</span></code></pre>
<h2 id="taxonomies">taxonomies<a class="heading-anchor" href="#taxonomies" aria-hidden="true" tabindex="-1"></a></h2>
<p>List of vocabularies, paired by plural and singular value.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">taxonomies:</span>
  <span class="hljs-string">&lt;plural&gt;:</span> <span class="hljs-string">&lt;singular&gt;</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">taxonomies:</span>
  <span class="hljs-attr">categories:</span> <span class="hljs-string">category</span>
  <span class="hljs-attr">tags:</span> <span class="hljs-string">tag</span></code></pre>
<p>Then you can use those vocabularies in your content’s <a href="/content/front-matter/#taxonomy">front matter</a>.</p>
<aside class="note note-warning"><p>Since <ins>version 8.37.0</ins>, default vocabularies <code translate="no">category</code> and <code translate="no">tag</code> have been removed. You must define them in the configuration file if you want to use them.</p></aside>
<aside class="note note-tip"><p>A vocabulary can be disabled with the special value <code translate="no">disabled</code>. Example: <code translate="no">tags: disabled</code>.</p></aside>
<h2 id="theme">theme<a class="heading-anchor" href="#theme" aria-hidden="true" tabindex="-1"></a></h2>
<p>The theme to use, or a list of themes.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">theme:</span> <span class="hljs-string">&lt;theme&gt;</span> <span class="hljs-comment"># theme name</span>
<span class="hljs-comment"># or</span>
<span class="hljs-attr">theme:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;theme1&gt;</span> <span class="hljs-comment"># theme name</span>
  <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;theme2&gt;</span></code></pre>
<aside class="note note-info"><p>The first theme overrides the others, and so on.</p></aside>
<aside class="note note-info"><p>A theme can <a href="/templates/extend/#required-themes">require other themes</a>: they are enabled with it, after the themes of the list.</p></aside>
<p><em>Examples:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">theme:</span> <span class="hljs-string">hyde</span></code></pre>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">theme:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-string">pwa</span>
  <span class="hljs-bullet">-</span> <span class="hljs-string">hyde</span></code></pre>
<aside class="note note-info"><p>See <a href="https://github.com/Cecilapp?q=theme#org-repositories" target="_blank" rel="noopener noreferrer">themes on GitHub</a> or the <a href="https://cecil.app/themes/">themes section</a> of the website.</p></aside>
<h2 id="date">date<a class="heading-anchor" href="#date" aria-hidden="true" tabindex="-1"></a></h2>
<p>Date format and timezone.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">date:</span>
  <span class="hljs-attr">format:</span> <span class="hljs-string">&lt;format&gt;</span>     <span class="hljs-comment"># date format (optional, `F j, Y` by default)</span>
  <span class="hljs-attr">timezone:</span> <span class="hljs-string">&lt;timezone&gt;</span> <span class="hljs-comment"># date timezone (optional, local time zone by default)</span></code></pre>
<ul>
<li><code translate="no">format</code>: <a href="https://php.net/date" target="_blank" rel="noopener noreferrer">PHP date</a> format specifier</li>
<li><code translate="no">timezone</code>: see <a href="https://php.net/timezones" target="_blank" rel="noopener noreferrer">timezones</a></li>
</ul>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">date:</span>
  <span class="hljs-attr">format:</span> <span class="hljs-string">'j F, Y'</span>
  <span class="hljs-attr">timezone:</span> <span class="hljs-string">'Europe/Paris'</span></code></pre>
<h2 id="metatags">metatags<a class="heading-anchor" href="#metatags" aria-hidden="true" tabindex="-1"></a></h2>
<p><em>metatags</em> are <abbr title="Search Engine Optimization">SEO</abbr> and social helpers that can be automatically injected in the <code translate="no">&lt;head&gt;</code>, with the template <a href="https://github.com/Cecilapp/Cecil/blob/main/resources/layouts/partials/metatags.html.twig" target="_blank" rel="noopener noreferrer"><code translate="no">partials/metatags.html.twig</code></a>.</p>
<p>This template adds the following meta tags:</p>
<ul>
<li>Page title + Site title, or Site title + Site baseline</li>
<li>Page/Site description</li>
<li>Page/Site keywords</li>
<li>Page/Site author</li>
<li>Search engine crawler directives (<em>robots</em>)</li>
<li>Favicon links</li>
<li>Navigation links (first, previous, next, last)</li>
<li>Canonical URL</li>
<li>Alternate links (e.g.: RSS feed, other languages)</li>
<li><a href="https://developer.mozilla.org/docs/Web/HTML/Reference/Attributes/rel/me" target="_blank" rel="noopener noreferrer"><code translate="no">rel=me</code></a> links</li>
<li><a href="https://ogp.me" target="_blank" rel="noopener noreferrer">Open Graph</a></li>
<li>Facebook profile ID</li>
<li><a href="https://developer.x.com/docs/x-for-websites/cards/guides/getting-started" target="_blank" rel="noopener noreferrer">Twitter/X Card</a></li>
<li><a href="https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/" target="_blank" rel="noopener noreferrer">Fediverse tag</a></li>
<li><a href="https://www.dublincore.org/specifications/dublin-core/dcmi-terms/" target="_blank" rel="noopener noreferrer">Dublin Core</a></li>
<li><a href="https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data" target="_blank" rel="noopener noreferrer">Structured data</a> (JSON-LD)</li>
</ul>
<h3 id="metatags-options">metatags options<a class="heading-anchor" href="#metatags-options" aria-hidden="true" tabindex="-1"></a></h3>
<p>Cecil uses page front matter to feed meta tags, and falls back to site options when needed.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">title:</span> <span class="hljs-string">"Page/Site title"</span>              <span class="hljs-comment"># used by title meta</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">"Page/Site description"</span>  <span class="hljs-comment"># used by description meta</span>
<span class="hljs-attr">tags:</span> <span class="hljs-string">[tag1,</span> <span class="hljs-string">tag2]</span>                    <span class="hljs-comment"># used by keywords meta</span>
<span class="hljs-attr">keywords:</span> <span class="hljs-string">[keyword1,</span> <span class="hljs-string">keyword2]</span>        <span class="hljs-comment"># obsolete in page front matter (use `tags`)</span>
<span class="hljs-attr">author:</span>                               <span class="hljs-comment"># used by author meta</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">&lt;name&gt;</span>                          <span class="hljs-comment"># author name</span>
  <span class="hljs-attr">url:</span> <span class="hljs-string">&lt;url&gt;</span>                            <span class="hljs-comment"># author URL</span>
  <span class="hljs-attr">email:</span> <span class="hljs-string">&lt;email&gt;</span>                        <span class="hljs-comment"># author email</span>
<span class="hljs-attr">image:</span> <span class="hljs-string">image.jpg</span>                      <span class="hljs-comment"># used by Open Graph and social networks cards</span>
<span class="hljs-attr">canonical:</span>                            <span class="hljs-comment"># used to override the generated canonical URL</span>
  <span class="hljs-attr">url:</span> <span class="hljs-string">&lt;URL&gt;</span>                            <span class="hljs-comment"># absolute URL</span>
  <span class="hljs-attr">title:</span> <span class="hljs-string">"&lt;URL title&gt;"</span>                  <span class="hljs-comment"># optional canonical title</span>
<span class="hljs-attr">social:</span>                               <span class="hljs-comment"># used by social networks meta</span>
  <span class="hljs-attr">twitter:</span>                              <span class="hljs-comment"># used by Twitter/X Card</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">&lt;URL&gt;</span>                            <span class="hljs-comment"># used for `rel=me` link</span>
    <span class="hljs-attr">site:</span> <span class="hljs-string">username</span>                        <span class="hljs-comment"># site username</span>
    <span class="hljs-attr">creator:</span> <span class="hljs-string">username</span>                     <span class="hljs-comment"># page author username</span>
  <span class="hljs-attr">mastodon:</span>                             <span class="hljs-comment"># used by Mastodon meta</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">&lt;URL&gt;</span>                            <span class="hljs-comment"># used for `rel=me` link</span>
    <span class="hljs-attr">creator:</span> <span class="hljs-string">handle</span>                       <span class="hljs-comment"># page author account</span>
  <span class="hljs-attr">facebook:</span>                             <span class="hljs-comment"># used by Facebook meta</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">&lt;URL&gt;</span>                            <span class="hljs-comment"># used for `rel=me` link</span>
    <span class="hljs-attr">id:</span> <span class="hljs-number">123456789</span>                         <span class="hljs-comment"># Facebook profile ID</span>
    <span class="hljs-attr">username:</span> <span class="hljs-string">username</span>                    <span class="hljs-comment"># page author username</span></code></pre>
<aside class="note note-tip"><p>If needed, <code translate="no">title</code> and <code translate="no">image</code> can be overridden:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ <span class="hljs-name">include</span><span class="hljs-params">('partials/metatags.html.twig', {title: 'Custom title', image: 'images/og.png'})</span> }}</span></code></pre>
<p><code translate="no">image</code> accepts a path or an <a href="/assets/">asset</a>.</p></aside>
<h3 id="metatags-configuration">metatags configuration<a class="heading-anchor" href="#metatags-configuration" aria-hidden="true" tabindex="-1"></a></h3>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">metatags:</span>
  <span class="hljs-attr">title:</span>                   <span class="hljs-comment"># title options</span>
    <span class="hljs-attr">divider:</span> <span class="hljs-string">" &amp;middot; "</span>    <span class="hljs-comment"># string between page title and site title</span>
    <span class="hljs-attr">only:</span> <span class="hljs-literal">false</span>              <span class="hljs-comment"># displays page title only (`false` by default)</span>
    <span class="hljs-attr">pagination:</span>              <span class="hljs-comment"># pagination options</span>
      <span class="hljs-attr">shownumber:</span> <span class="hljs-literal">true</span>         <span class="hljs-comment"># displays page number in title (`true` by default)</span>
      <span class="hljs-attr">label:</span> <span class="hljs-string">"Page %s"</span>         <span class="hljs-comment"># how to display page number (`Page %s` by default)</span>
  <span class="hljs-attr">robots:</span> <span class="hljs-string">"index,follow"</span>   <span class="hljs-comment"># web crawlers directives (`index,follow` by default)</span>
  <span class="hljs-attr">favicon:</span>                 <span class="hljs-comment"># favicon options (set `favicon: false` to disable)</span>
    <span class="hljs-attr">image:</span> <span class="hljs-string">favicon.png</span>       <span class="hljs-comment"># path to favicon image (`favicon.png` by default)</span>
    <span class="hljs-attr">sizes:</span>                   <span class="hljs-comment"># sizes by device</span>
      <span class="hljs-attr">"icon":</span> <span class="hljs-string">[32,</span> <span class="hljs-number">57</span><span class="hljs-string">,</span> <span class="hljs-number">76</span><span class="hljs-string">,</span> <span class="hljs-number">96</span><span class="hljs-string">,</span> <span class="hljs-number">128</span><span class="hljs-string">,</span> <span class="hljs-number">192</span><span class="hljs-string">,</span> <span class="hljs-number">228</span><span class="hljs-string">]</span>  <span class="hljs-comment"># web browsers</span>
      <span class="hljs-attr">"shortcut icon":</span> <span class="hljs-string">[128,</span> <span class="hljs-number">196</span><span class="hljs-string">]</span>              <span class="hljs-comment"># Android</span>
      <span class="hljs-attr">"apple-touch-icon":</span> <span class="hljs-string">[120,</span> <span class="hljs-number">152</span><span class="hljs-string">,</span> <span class="hljs-number">180</span><span class="hljs-string">]</span>      <span class="hljs-comment"># iOS</span>
  <span class="hljs-attr">navigation:</span> <span class="hljs-literal">true</span>         <span class="hljs-comment"># includes previous and next links (`true` by default)</span>
  <span class="hljs-attr">image:</span> <span class="hljs-literal">true</span>              <span class="hljs-comment"># includes image (`true` by default)</span>
  <span class="hljs-attr">og:</span> <span class="hljs-literal">true</span>                 <span class="hljs-comment"># includes Open Graph meta tags (`true` by default)</span>
  <span class="hljs-attr">articles:</span> <span class="hljs-string">"blog"</span>         <span class="hljs-comment"># articles' section(s): a section or a list of sections (`blog` by default)</span>
  <span class="hljs-attr">twitter:</span> <span class="hljs-literal">true</span>            <span class="hljs-comment"># includes Twitter/X Card meta tags (`true` by default)</span>
  <span class="hljs-attr">mastodon:</span> <span class="hljs-literal">true</span>           <span class="hljs-comment"># includes Mastodon meta tags (`true` by default)</span>
  <span class="hljs-attr">dc:</span> <span class="hljs-literal">false</span>                <span class="hljs-comment"># includes Dublin Core meta tags (`false` by default)</span>
  <span class="hljs-attr">data:</span> <span class="hljs-literal">false</span>              <span class="hljs-comment"># includes JSON-LD structured data (`false` by default), see below for options</span></code></pre>
<aside class="note note-info"><p>Pages whose <code translate="no">robots</code> directives (<code translate="no">metatags.robots</code> in front matter, or the <code translate="no">metatags.robots</code> site option as fallback) contain <code translate="no">noindex</code> are excluded from the XML sitemap.</p></aside>
<h3 id="structured-data">Structured data<a class="heading-anchor" href="#structured-data" aria-hidden="true" tabindex="-1"></a></h3>
<p>When enabled, structured data are added as a <a href="https://json-ld.org" target="_blank" rel="noopener noreferrer">JSON-LD</a> graph of linked entities (<a href="https://schema.org" target="_blank" rel="noopener noreferrer">schema.org</a>):</p>
<ul>
<li><code translate="no">WebSite</code> and its publisher (<code translate="no">Organization</code> or <code translate="no">Person</code>)</li>
<li><code translate="no">WebPage</code> (<code translate="no">CollectionPage</code> for the homepage, sections and taxonomies pages), except for the 404 page</li>
<li><code translate="no">BreadcrumbList</code>: home, ancestor sections (or vocabulary) and current page</li>
<li><code translate="no">BlogPosting</code> for pages of the articles' section(s) (see <code translate="no">metatags.articles</code>)</li>
<li><code translate="no">VideoObject</code> for pages with a video and an image (used as thumbnail)</li>
<li><code translate="no">ItemList</code> of the main menu entries</li>
</ul>
<p><code translate="no">metatags.data</code> accepts <code translate="no">true</code> or a map of options:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">metatags:</span>
  <span class="hljs-attr">data:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>            <span class="hljs-comment"># enables JSON-LD structured data (`true` if `data` is a map)</span>
    <span class="hljs-attr">article:</span> <span class="hljs-string">BlogPosting</span>     <span class="hljs-comment"># schema.org type of articles (`BlogPosting` by default, e.g. `NewsArticle`)</span>
    <span class="hljs-attr">publisher:</span>               <span class="hljs-comment"># entity that publishes the site</span>
      <span class="hljs-attr">type:</span> <span class="hljs-string">Organization</span>       <span class="hljs-comment"># `Organization` (default) or `Person` (personal site)</span>
      <span class="hljs-attr">name:</span> <span class="hljs-string">&lt;name&gt;</span>             <span class="hljs-comment"># site title by default (site author name for a `Person`)</span>
      <span class="hljs-attr">logo:</span> <span class="hljs-string">logo.png</span>           <span class="hljs-comment"># favicon image (`favicon.png`) by default</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">&lt;url&gt;</span>               <span class="hljs-comment"># site URL by default</span>
      <span class="hljs-attr">sameAs:</span> <span class="hljs-string">[&lt;url&gt;,</span> <span class="hljs-string">&lt;url&gt;]</span>   <span class="hljs-comment"># `url` of `social` entries by default</span></code></pre>
<p>The page front matter can override some options:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">metatags:</span>
  <span class="hljs-attr">data:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">false</span>           <span class="hljs-comment"># disables structured data for this page</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">AboutPage</span>          <span class="hljs-comment"># page type (e.g. `AboutPage`, `ContactPage`, `ProfilePage`, `FAQPage`)</span>
    <span class="hljs-attr">article:</span> <span class="hljs-string">NewsArticle</span>     <span class="hljs-comment"># article type</span></code></pre>
<aside class="note note-info"><p>The author of an article is built from the <code translate="no">author</code> front matter (<code translate="no">name</code>, <code translate="no">url</code>, <code translate="no">image</code>, <code translate="no">title</code>) and from <code translate="no">social.*.url</code> page entries. Without author, the publisher is used.</p></aside>
<aside class="note note-tip"><p>In <a href="#debug">debug mode</a>, the JSON-LD is pretty-printed to be human readable (unless HTML files are <a href="/documentation/server/#optimize">optimized</a>).</p></aside>
<h2 id="debug">debug<a class="heading-anchor" href="#debug" aria-hidden="true" tabindex="-1"></a></h2>
<p>Enables the <em>debug mode</em>, used to display debug information like very verbose logs, Twig dump, Twig profiler, SCSS sourcemap, etc.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">debug:</span> <span class="hljs-literal">true</span></code></pre>
<p>There are two other ways to enable <em>debug mode</em>:</p>
<ol>
<li>Run a command with the <code translate="no">-vvv</code> option</li>
<li>Set the <code translate="no">CECIL_DEBUG</code> environment variable to <code translate="no">true</code></li>
</ol>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/content/pages/</id>
    <title>Pages and sections</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/content/pages/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Pages and sections</h1>
<p>A page is a file made up of a <a href="#front-matter"><strong>front matter</strong></a> and a <a href="#body"><strong>body</strong></a>.</p>
<aside class="note note-info"><p>Pages are files stored in the <code translate="no">pages/</code> directory, with one of the following extensions: <code translate="no">md</code>, <code translate="no">markdown</code>, <code translate="no">mdown</code>, <code translate="no">mkdn</code>, <code translate="no">mkd</code>, <code translate="no">text</code> or <code translate="no">txt</code> (see <a href="/configuration/pages/#pages-ext"><code translate="no">pages.ext</code></a>).</p>
<p>A <code translate="no">README.md</code> file is handled as an <code translate="no">index.md</code> file (e.g.: <code translate="no">blog/README.md</code> is the index of the <code translate="no">blog</code> <em>Section</em>).</p></aside>
<h2 id="front-matter">Front matter<a class="heading-anchor" href="#front-matter" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <em>front matter</em> is a collection of <a href="/documentation/front-matter/">variables</a> (in <em>key/value</em> format) surrounded by <code translate="no">---</code>.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">title:</span> <span class="hljs-string">"The title"</span>
<span class="hljs-attr">date:</span> <span class="hljs-number">2019</span><span class="hljs-number">-02</span><span class="hljs-number">-21</span>
<span class="hljs-attr">tags:</span> <span class="hljs-string">[tag</span> <span class="hljs-number">1</span><span class="hljs-string">,</span> <span class="hljs-string">tag</span> <span class="hljs-number">2</span><span class="hljs-string">]</span>
<span class="hljs-attr">customvar:</span> <span class="hljs-string">"Value of customvar"</span>
<span class="hljs-meta">---</span></code></pre>
<aside class="note note-info"><p>You can also use <code translate="no">&lt;!-- --&gt;</code> or <code translate="no">+++</code> as separator.</p></aside>
<h2 id="body">Body<a class="heading-anchor" href="#body" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <em>body</em> is the main content of a page; it can be written in <a href="/documentation/markdown/">Markdown</a> or in plain text.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no"><span class="hljs-section"># Header</span>

[toc]

<span class="hljs-section">## Sub-Header 1</span>

Lorem ipsum dolor [<span class="hljs-string">sit amet</span>](<span class="hljs-link">https://example.com</span>), consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<span class="xml"><span class="hljs-comment">&lt;!-- excerpt --&gt;</span></span>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<span class="hljs-section">## Sub-Header 2</span>

![<span class="hljs-string">Description</span>](<span class="hljs-link">/image.jpg "Title"</span>)

<span class="hljs-section">## Sub-Header 3</span>

:::tip
This is advice.
:::</code></pre>
<h2 id="file-prefix">File prefix<a class="heading-anchor" href="#file-prefix" aria-hidden="true" tabindex="-1"></a></h2>
<p>The filename can contain a prefix to define <code translate="no">date</code> or <code translate="no">weight</code> variables of the page (used by <a href="/templates/reference/sorts/#sort-by-date"><code translate="no">sortby</code></a>).</p>
<aside class="note note-info"><p>Default prefix separators: <code translate="no">_</code> and <code translate="no">-</code>.</p>
<p>You can customize them with the <a href="/configuration/pages/#pages-prefix-separator"><code translate="no">pages.prefix.separator</code></a> option.</p></aside>
<h3 id="date">date<a class="heading-anchor" href="#date" aria-hidden="true" tabindex="-1"></a></h3>
<p>The <em>date prefix</em> is used to set the <code translate="no">date</code> of the page, and must be a valid date format (i.e.: <code translate="no">YYYY-MM-DD</code>).</p>
<p><em>Example:</em></p>
<p>In <code translate="no">2019-04-23_My blog post.md</code>:</p>
<ul>
<li>the prefix is <code translate="no">2019-04-23</code></li>
<li>the <code translate="no">date</code> of the page is <code translate="no">2019-04-23</code></li>
<li>the <code translate="no">title</code> of the page is <code translate="no">My blog post</code></li>
</ul>
<h3 id="weight">weight<a class="heading-anchor" href="#weight" aria-hidden="true" tabindex="-1"></a></h3>
<p>The <em>weight prefix</em> is used to set the sort order of the page, and must be a valid integer value.</p>
<p><em>Example:</em></p>
<p>In <code translate="no">1_The first project.md</code>:</p>
<ul>
<li>the prefix is <code translate="no">1</code></li>
<li>the <code translate="no">weight</code> of the page is <code translate="no">1</code></li>
<li>the <code translate="no">title</code> of the page is <code translate="no">The first project</code></li>
</ul>
<h2 id="section">Section<a class="heading-anchor" href="#section" aria-hidden="true" tabindex="-1"></a></h2>
<p>Some dedicated variables can be used in a custom <em>Section</em> (i.e.: <code translate="no">&lt;section&gt;/index.md</code>).</p>
<h3 id="sortby">sortby<a class="heading-anchor" href="#sortby" aria-hidden="true" tabindex="-1"></a></h3>
<p>The order of pages in a <em>Section</em> can be changed.</p>
<p>Available values are:</p>
<ul>
<li><code translate="no">date</code>: more recent first</li>
<li><code translate="no">updated</code>: more recently updated first</li>
<li><code translate="no">title</code>: alphabetic order</li>
<li><code translate="no">weight</code>: lightest first</li>
</ul>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">sortby:</span> <span class="hljs-string">title</span>
<span class="hljs-meta">---</span></code></pre>
<p><strong>More options:</strong></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">sortby:</span>
  <span class="hljs-attr">variable:</span> <span class="hljs-string">date</span>    <span class="hljs-comment"># "date", "updated", "title" or "weight"</span>
  <span class="hljs-attr">desc_title:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># used with "date" or "updated" variable value to sort by desc title order if items have the same date</span>
  <span class="hljs-attr">reverse:</span> <span class="hljs-literal">false</span>    <span class="hljs-comment"># reversed if true</span>
<span class="hljs-meta">---</span></code></pre>
<h3 id="pagination">pagination<a class="heading-anchor" href="#pagination" aria-hidden="true" tabindex="-1"></a></h3>
<p>The global <a href="/configuration/pages/#pages-pagination">pagination configuration</a> is used by default, but you can change it for a specific <em>Section</em>.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">pagination:</span>
  <span class="hljs-attr">max:</span> <span class="hljs-number">5</span>
  <span class="hljs-attr">path:</span> <span class="hljs-string">"page"</span>
<span class="hljs-meta">---</span></code></pre>
<p>Pagination can be disabled for a <em>Section</em>:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">pagination:</span> <span class="hljs-literal">false</span>
<span class="hljs-meta">---</span></code></pre>
<p>If pagination is <a href="/configuration/pages/#disable-pagination">disabled globally</a>, it can be enabled for a <em>Section</em> (<code translate="no">max</code> and <code translate="no">path</code> default to the global configuration):</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">pagination:</span>
  <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">max:</span> <span class="hljs-number">5</span>
<span class="hljs-meta">---</span></code></pre>
<h3 id="cascade">cascade<a class="heading-anchor" href="#cascade" aria-hidden="true" tabindex="-1"></a></h3>
<p>Any variables in <code translate="no">cascade</code> are added to the front matter of all pages of the <em>Section</em> (including pages of its <a href="#sub-section">sub-sections</a>).</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">cascade:</span>
  <span class="hljs-attr">banner:</span> <span class="hljs-string">image.jpg</span>
<span class="hljs-meta">---</span></code></pre>
<aside class="note note-info"><p>Existing variables are not overridden.</p></aside>
<h3 id="circular">circular<a class="heading-anchor" href="#circular" aria-hidden="true" tabindex="-1"></a></h3>
<p>Set <code translate="no">circular</code> to <code translate="no">true</code> to enable circular navigation with <a href="/templates/variables/#page-prev-next"><em>page.&lt;prev/next&gt;</em></a>.</p>
<aside class="note note-info"><p>With <a href="#sub-section">sub-sections</a>, only the <code translate="no">circular</code> value of the top level <em>Section</em> is used.</p></aside>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">circular:</span> <span class="hljs-literal">true</span>
<span class="hljs-meta">---</span></code></pre>
<h3 id="sub-section">Sub-section<a class="heading-anchor" href="#sub-section" aria-hidden="true" tabindex="-1"></a></h3>
<p>A nested folder that explicitly contains an <code translate="no">index.md</code> file is turned into a <em>sub-section</em> of its parent <em>Section</em>.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">&lt;mywebsite&gt;
└─ pages
   └─ blog                 &lt;- Section
      ├─ index.md
      ├─ post-1.md         &lt;- Page in Section "blog"
      └─ 2024              &lt;- Sub-section (contains an "index.md")
         ├─ index.md
         └─ post-2.md      &lt;- Page in Section "blog" *and* sub-section "blog/2024"</code></pre>
<p>A <em>sub-section</em>:</p>
<ul>
<li>is a <em>Section</em> (same type, variables and <a href="/templates/lookup-rules/#type-section">layout</a> resolution) available at its own URL (e.g.: <code translate="no">/blog/2024/</code>)</li>
<li>is rendered with the layouts of its parent <em>Sections</em> if it doesn't have its own (e.g.: <code translate="no">blog/list.html.twig</code>)</li>
<li>can be nested at any depth (e.g.: <code translate="no">blog/2024/06/</code>)</li>
<li>lists its own pages, and its pages also belong to each of their parent <em>Sections</em></li>
<li>is <strong>not</strong> listed in its parent <em>Section</em></li>
<li>is placed in the <a href="/templates/variables/#page-prev-next"><em>page.&lt;prev/next&gt;</em></a> navigation of its parent <em>Section</em> (according to its <code translate="no">sortby</code>), followed by its own pages</li>
</ul>
<aside class="note note-info"><p>A nested folder <strong>without</strong> an <code translate="no">index.md</code> file is not a <em>sub-section</em>: its pages simply belong to the parent <em>Section</em>.</p></aside>
<h2 id="home-page">Home page<a class="heading-anchor" href="#home-page" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <em>Home page</em> is the <code translate="no">pages/index.md</code> file.</p>
<p>Like any other <em>Section</em>, the <em>Home page</em> supports <code translate="no">sortby</code> and <code translate="no">pagination</code> configuration.</p>
<h3 id="pagesfrom">pagesfrom<a class="heading-anchor" href="#pagesfrom" aria-hidden="true" tabindex="-1"></a></h3>
<p>Set a valid <em>Section</em> name in <code translate="no">pagesfrom</code> to use pages collection from this <em>Section</em> in <em>Home page</em>.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">pagesfrom:</span> <span class="hljs-string">blog</span>
<span class="hljs-meta">---</span></code></pre>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/lookup-rules/</id>
    <title>Organization and lookup rules</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/lookup-rules/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Organization and lookup rules</h1>
<p>Cecil renders pages with Twig templates: this page explains how templates are organized and how the right one is chosen for each page.</p>
<h2 id="files-organization">Files organization<a class="heading-anchor" href="#files-organization" aria-hidden="true" tabindex="-1"></a></h2>
<h3 id="kinds-of-templates">Kinds of templates<a class="heading-anchor" href="#kinds-of-templates" aria-hidden="true" tabindex="-1"></a></h3>
<p>There are three kinds of templates: <strong><em>layouts</em></strong>, <strong><em>components</em></strong>, and <strong><em>other templates</em></strong>. <em>Layouts</em> are used to render <a href="/content/pages/">pages</a>, and each layout can <a href="https://twig.symfony.com/doc/templates.html#including-other-templates" target="_blank" rel="noopener noreferrer">include templates</a> and <a href="/documentation/components/">components</a>.</p>
<h3 id="naming-convention">Naming convention<a class="heading-anchor" href="#naming-convention" aria-hidden="true" tabindex="-1"></a></h3>
<p>Template files are stored in the <code translate="no">layouts/</code> directory and must be named according to the following convention:</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">layouts/(&lt;section&gt;/)&lt;type&gt;|&lt;layout&gt;.&lt;format&gt;(.&lt;language&gt;).twig</code></pre>
<dl>
<dt><code translate="no">&lt;section&gt;</code> (<em>optional</em>)</dt>
<dd>The section of the page (e.g.: <code translate="no">blog</code>).</dd>
<dt><code translate="no">&lt;type&gt;</code></dt>
<dd>The template type: <code translate="no">home</code> (or <code translate="no">index</code>) for the <em>homepage</em>, <code translate="no">list</code> for list pages (<em>homepage</em> and <em>sections</em>), <code translate="no">page</code> for a <em>page</em>, etc. (See <a href="#lookup-rules"><em>Lookup rules</em></a> for details).</dd>
<dt><code translate="no">&lt;layout&gt;</code> (<em>optional</em>)</dt>
<dd>The custom layout name defined in the <a href="/content/pages/#front-matter">front matter</a> of the page (e.g.: <code translate="no">layout: my-layout</code>).</dd>
<dt><code translate="no">&lt;format&gt;</code></dt>
<dd>The <a href="/configuration/output/#output-formats">output format</a> of the rendered page (e.g.: <code translate="no">html</code>, <code translate="no">rss</code>, <code translate="no">json</code>, <code translate="no">xml</code>, etc.).</dd>
<dt><code translate="no">&lt;language&gt;</code> (<em>optional</em>)</dt>
<dd>The language of the page (e.g.: <code translate="no">fr</code>).</dd>
</dl>
<p><em>Examples:</em></p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">layouts/home.html.twig       # `type` is "homepage"
layouts/page.html.twig       # `type` is "page"
layouts/page.html.fr.twig    # `type` is "page" and `language` is "fr"
layouts/my-layout.html.twig  # `layout` is "my-layout"
layouts/blog/list.html.twig  # `section` is "blog"
layouts/blog/list.rss.twig   # `section` is "blog" and `format` is "rss"</code></pre>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">&lt;my-site&gt;
├─ ...
├─ layouts
|  ├─ index.html.twig      # Used by type "homepage"
|  ├─ list.html.twig       # Used by types "homepage" and "section"
|  ├─ list.rss.twig        # Used by types "homepage" and "section", for RSS output format
|  ├─ page.html.twig       # Used by type "page"
|  ├─ taxonomy
|  |  ├─ tags.html.twig    # Used by type "vocabulary" of `tags` (list of terms)
|  |  └─ tag.html.twig     # Used by type "term" of `tags` (list of pages)
|  ├─ my-layout.html.twig  # Used by pages with `layout: my-layout` in the front matter
|  ├─ ...
|  └─ partials             # Included templates
|     ├─ footer.html.twig
|     └─ ...
└─ themes                  # Themes layouts and templates
   └─ ...</code></pre>
<h3 id="built-in-templates">Built-in templates<a class="heading-anchor" href="#built-in-templates" aria-hidden="true" tabindex="-1"></a></h3>
<p>Cecil comes with a set of <a href="https://github.com/Cecilapp/Cecil/tree/main/resources/layouts" target="_blank" rel="noopener noreferrer">built-in templates</a>.</p>
<aside class="note note-tip"><p>If you need to modify built-in templates, you can easily extract them via the following command: they will be copied into the <code translate="no">layouts</code> directory of your site.</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar util:templates:extract</code></pre></aside>
<h2 id="lookup-rules">Lookup rules<a class="heading-anchor" href="#lookup-rules" aria-hidden="true" tabindex="-1"></a></h2>
<p>In most cases <strong>you don’t need to specify the layout</strong>: Cecil selects the most appropriate layout, according to the <strong>page type</strong>.</p>
<p>For example, the HTML output of the <strong>home page</strong> (<code translate="no">index.md</code>) will be rendered:</p>
<ol>
<li>with <code translate="no">my-layout.html.twig</code> if the <code translate="no">layout</code> variable is set to "my-layout" (in the front matter)</li>
<li>if not, with <code translate="no">index.html.twig</code> if the file exists</li>
<li>if not, with <code translate="no">home.html.twig</code> if the file exists</li>
<li>if not, with <code translate="no">list.html.twig</code> if the file exists</li>
</ol>
<p>All rules are detailed below, for each page type, in the priority order.</p>
<aside class="note note-info"><p>Each candidate template is searched in the <code translate="no">layouts/</code> directory of the site, then in the <code translate="no">layouts/</code> directory of each <a href="/documentation/extend/#theme">theme</a> (in the configured order), then in the built-in templates. The first file found is used.</p></aside>
<aside class="note note-tip"><p>For a page in a language other than the default one, the localized variant of each candidate (e.g.: <code translate="no">page.html.fr.twig</code>) is tried first: all localized candidates are looked up before the non-localized ones.</p></aside>
<h3 id="type-homepage">Type <em>homepage</em><a class="heading-anchor" href="#type-homepage" aria-hidden="true" tabindex="-1"></a></h3>
<ol>
<li><code translate="no">&lt;layout&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">index.&lt;format&gt;.twig</code></li>
<li><code translate="no">home.&lt;format&gt;.twig</code></li>
<li><code translate="no">list.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/&lt;layout&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/index.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/home.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/list.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/page.&lt;format&gt;.twig</code></li>
</ol>
<h3 id="type-page">Type <em>page</em><a class="heading-anchor" href="#type-page" aria-hidden="true" tabindex="-1"></a></h3>
<ol>
<li><code translate="no">&lt;section&gt;/&lt;layout&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">&lt;layout&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">&lt;section&gt;/page.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/&lt;layout&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">page.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/page.&lt;format&gt;.twig</code></li>
</ol>
<h3 id="type-section">Type <em>section</em><a class="heading-anchor" href="#type-section" aria-hidden="true" tabindex="-1"></a></h3>
<ol>
<li><code translate="no">&lt;layout&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">&lt;section&gt;/index.&lt;format&gt;.twig</code></li>
<li><code translate="no">&lt;section&gt;/list.&lt;format&gt;.twig</code></li>
<li><code translate="no">section/&lt;section&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">&lt;parent&gt;/index.&lt;format&gt;.twig</code>, <code translate="no">&lt;parent&gt;/list.&lt;format&gt;.twig</code> and <code translate="no">section/&lt;parent&gt;.&lt;format&gt;.twig</code>, for each parent section of a sub-section (nearest first)</li>
<li><code translate="no">_default/section.&lt;format&gt;.twig</code></li>
<li><code translate="no">list.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/list.&lt;format&gt;.twig</code></li>
</ol>
<aside class="note note-tip"><p>The <code translate="no">&lt;section&gt;</code> of a <a href="/content/pages/#sub-section">sub-section</a> is its full path (e.g.: <code translate="no">blog/2024</code>), and a sub-section falls back to the templates of its parent sections: if <code translate="no">blog/2024/list.html.twig</code> doesn’t exist, the sub-section <code translate="no">blog/2024</code> is rendered with <code translate="no">blog/list.html.twig</code>.</p></aside>
<aside class="note note-info"><p>The name used as <code translate="no">&lt;section&gt;</code> (for a section and its pages) can be mapped to the layouts of another section with the <a href="/configuration/layouts/#layouts-sections"><code translate="no">layouts.sections</code></a> option.</p></aside>
<h3 id="type-vocabulary">Type <em>vocabulary</em><a class="heading-anchor" href="#type-vocabulary" aria-hidden="true" tabindex="-1"></a></h3>
<ol>
<li><code translate="no">taxonomy/&lt;plural&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">vocabulary.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/vocabulary.&lt;format&gt;.twig</code></li>
</ol>
<h3 id="type-term">Type <em>term</em><a class="heading-anchor" href="#type-term" aria-hidden="true" tabindex="-1"></a></h3>
<ol>
<li><code translate="no">taxonomy/&lt;plural&gt;/&lt;term&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">taxonomy/&lt;singular&gt;.&lt;format&gt;.twig</code></li>
<li><code translate="no">term.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/term.&lt;format&gt;.twig</code></li>
<li><code translate="no">_default/list.&lt;format&gt;.twig</code></li>
</ol>
<aside class="note note-important"><p>The <strong>vocabulary</strong> template is named after the <strong>plural</strong> (e.g.: <code translate="no">taxonomy/categories.html.twig</code> for <code translate="no">/categories/</code>), whereas the <strong>term</strong> template is named after the <strong>singular</strong> (e.g.: <code translate="no">taxonomy/category.html.twig</code> for <code translate="no">/categories/data-sovereignty/</code>).</p></aside>
<aside class="note note-tip"><p><code translate="no">&lt;term&gt;</code> is the slugified term name: a dedicated template for the term "Data Sovereignty" of the <code translate="no">categories</code> vocabulary is <code translate="no">taxonomy/categories/data-sovereignty.html.twig</code>.</p></aside>
<aside class="note note-info"><p>Most of those layouts are available by default (in <code translate="no">_default/</code>), see <a href="#built-in-templates">built-in templates</a>.</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/reference/functions/</id>
    <title>Functions</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-22T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/reference/functions/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Functions</h1>
<blockquote>
<p><a href="https://twig.symfony.com/doc/functions/index.html" target="_blank" rel="noopener noreferrer">Functions</a> can be called to generate content. Functions are called by their name followed by parentheses (<code translate="no">()</code>) and may have arguments.</p>
</blockquote>
<aside class="note note-info"><p>See also: functions dedicated to assets (<code translate="no">asset</code>, <code translate="no">integrity</code>, <code translate="no">image_srcset</code>, <code translate="no">image_sizes</code>, <code translate="no">image_from_website</code>, etc.) are documented in the <a href="/assets/">Assets</a> section.</p></aside>
<h2 id="url">url<a class="heading-anchor" href="#url" aria-hidden="true" tabindex="-1"></a></h2>
<p>Creates a valid URL for a page, a menu entry, an asset, a page ID or a path.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ url(value, {options}) }}</span></code></pre>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Type</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>canonical</td>
<td>Prefixes URL with <a href="/configuration/site/#baseurl"><code translate="no">baseurl</code></a> or uses <a href="/configuration/site/#metatags-options"><code translate="no">canonical.url</code></a> if it exists.</td>
<td>boolean</td>
<td>value of <a href="/configuration/site/#canonicalurl"><code translate="no">canonicalurl</code></a> (<code translate="no">false</code> by default)</td>
</tr>
<tr>
<td>format</td>
<td>Defines page <a href="/configuration/output/#output-formats">output format</a> (e.g.: <code translate="no">json</code>).</td>
<td>string</td>
<td><code translate="no">html</code></td>
</tr>
<tr>
<td>language</td>
<td>Defines page <a href="/configuration/languages/#language">language</a> (e.g.: <code translate="no">fr</code>).</td>
<td>string</td>
<td>current language</td>
</tr>
</tbody>
</table>
<p><em>Examples:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# page #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url(page) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url(page, {canonical: true}) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url(page, {format: 'json'}) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url(page, {language: 'fr'}) }}</span><span class="xml">
</span><span class="hljs-comment">{# menu entry #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url(site.menus.main.about) }}</span><span class="xml">
</span><span class="hljs-comment">{# asset #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url(asset('styles.css')) }}</span><span class="xml">
</span><span class="hljs-comment">{# page ID #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url('page-id') }}</span><span class="xml">
</span><span class="hljs-comment">{# path #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url('about-me/') }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ url('tags/' ~ tag) }}</span></code></pre>
<aside class="note note-info"><p>For convenience the <code translate="no">url</code> function is also available as a filter:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# page #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ page|url }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ page|url({canonical: true, format: 'json', language: 'fr'}) }}</span><span class="xml">
</span><span class="hljs-comment">{# asset #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset('styles.css')|url }}</span></code></pre></aside>
<aside class="note note-tip"><p>When the value is a string, <code translate="no">url()</code> slugifies it to find a matching page ID (e.g.: <code translate="no">url('tags/My Tag')</code> returns the URL of the page <code translate="no">tags/my-tag</code>). If no page matches, the string is kept as a path, with invalid characters (e.g.: spaces) percent-encoded.</p></aside>
<h2 id="html">html<a class="heading-anchor" href="#html" aria-hidden="true" tabindex="-1"></a></h2>
<p>Creates an HTML element from an asset (or an array of assets with custom attributes).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ html(asset, {attributes}, {options}) }}</span><span class="xml">
</span><span class="hljs-comment">{# dedicated functions for each common type of asset #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ css(asset) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ js(asset) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ image(asset) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ audio(asset) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ video(asset) }}</span></code></pre>
<table>
<thead>
<tr>
<th>Argument</th>
<th>Description</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>attributes</td>
<td>Adds <code translate="no">name="value"</code> couple to the HTML element.</td>
<td>array</td>
</tr>
<tr>
<td>options</td>
<td><code translate="no">{preload: boolean}</code>: preloads.<br>For images:<br><code translate="no">{formats: array}</code>: adds alternative formats.<br><code translate="no">{responsive: bool|string}</code>: adds responsive images (based on <code translate="no">width</code> or pixels <code translate="no">density</code>).<br><code translate="no">{placeholder: string}</code>: fills the image background before loading (<code translate="no">color</code> or <code translate="no">lqip</code>).</td>
<td>array</td>
</tr>
</tbody>
</table>
<aside class="note note-warning"><p>Since version <ins>8.42.0</ins>, the <code translate="no">html</code> function replaces the deprecated <code translate="no">html</code> filter.</p></aside>
<aside class="note note-tip"><p>You can define a global default behavior of images options (<code translate="no">formats</code>, <code translate="no">responsive</code> and <code translate="no">placeholder</code>) through the <a href="/configuration/layouts/#layouts-images">layouts configuration</a>.</p>
<p>When <a href="/configuration/layouts/#layouts-images"><code translate="no">layouts.images.dark_suffix</code></a> is configured (e.g. <code translate="no">.dark</code>), Cecil automatically looks for a dark variant of each image (e.g. <code translate="no">photo.dark.jpg</code> alongside <code translate="no">photo.jpg</code>) and generates a <code translate="no">&lt;picture&gt;</code> element with a <code translate="no">&lt;source media="(prefers-color-scheme: dark)"&gt;</code>.</p>
<p>In the same way, when <a href="/configuration/layouts/#layouts-images"><code translate="no">layouts.images.mobile_suffix</code></a> is configured (e.g. <code translate="no">.mobile</code>), Cecil looks for a mobile variant of each image (e.g. <code translate="no">photo.mobile.jpg</code>) and adds a <code translate="no">&lt;source&gt;</code> with the <a href="/configuration/layouts/#layouts-images"><code translate="no">layouts.images.mobile_media_query</code></a> media query. If a dark variant of the mobile image exists (e.g. <code translate="no">photo.mobile.dark.jpg</code>), it is used on mobile with dark color scheme.</p></aside>
<p><em>Examples:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# CSS with an attribute #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('print.css'), {media: 'print'}) }}</span><span class="xml">
</span><span class="hljs-comment">{# CSS with an attribute and an option #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('styles.css'), {title: 'Main theme'}, {preload: true}) }}</span><span class="xml">
</span><span class="hljs-comment">{# Array of assets with media query #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html([
  {asset: asset('css/style.css')},
  {asset: asset('css/style-dark.css'), attributes: {media: '(prefers-color-scheme: dark)'}}</span><span class="xml">
]) }}
</span><span class="hljs-comment">{# JavaScript #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('script.js')) }}</span><span class="xml">
</span><span class="hljs-comment">{# image without specific attributes nor options #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('image.png')) }}</span><span class="xml">
</span><span class="hljs-comment">{# image with specific attributes, responsive images and alternative formats #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('image.jpg'), {alt: 'Description', loading: 'lazy'}, {responsive: true, formats: ['avif', 'webp']}) }}</span><span class="xml">
</span><span class="hljs-comment">{# image with responsive pixels density images #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('image.jpg'), options={responsive: 'density'}, attributes={width: 256}) }}</span><span class="xml">
</span><span class="hljs-comment">{# image with a Low-Quality Image Placeholder #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('image.jpg'), {alt: 'Description', loading: 'lazy'}, {placeholder: 'lqip'}) }}</span><span class="xml">
</span><span class="hljs-comment">{# Audio #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('audio.mp3')) }}</span><span class="xml">
</span><span class="hljs-comment">{# Video #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ html(asset('video.mp4')) }}</span></code></pre>
<aside class="note note-info"><p>For convenience the <code translate="no">html</code> function remains available as a filter (deprecated):</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset|html({attributes}, {options}) }}</span></code></pre></aside>
<h2 id="readtime">readtime<a class="heading-anchor" href="#readtime" aria-hidden="true" tabindex="-1"></a></h2>
<p>Determines read time of a text, in minutes (based on 200 words per minute, 1 minute minimum).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ readtime(value) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ readtime(page.content) }}</span><span class="xml"> min</span></code></pre>
<h2 id="hash">hash<a class="heading-anchor" href="#hash" aria-hidden="true" tabindex="-1"></a></h2>
<p>Calculates the hash of an object, an array or a string with a given algorithm.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ hash(value, algorithm) }}</span></code></pre>
<p><code translate="no">algorithm</code> can be any algorithm supported by PHP’s <code translate="no">hash()</code> function (e.g.: <code translate="no">md5</code>, <code translate="no">sha256</code>, etc.). Default is <code translate="no">xxh128</code>.</p>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ hash('my string', 'sha256') }}</span></code></pre>
<h2 id="cache-key">cache_key<a class="heading-anchor" href="#cache-key" aria-hidden="true" tabindex="-1"></a></h2>
<p>Calculates a cache key for <a href="/cache/#fragments-cache"><em>fragments</em> cache</a> based on a name and an optional value.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">cache</span> cache_key(name, value) %}</span><span class="xml">
  </span><span class="hljs-comment">{# cacheable content #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name">endcache</span> %}</span></code></pre>
<p>The function adds a hash of the value (could be a string, an array or an object) to the name (and the current language and build ID to be sure the generated cache key is unique), so if the value changes, the cache key changes too and a new cache entry is generated.</p>
<h2 id="getenv">getenv<a class="heading-anchor" href="#getenv" aria-hidden="true" tabindex="-1"></a></h2>
<p>Gets the value of an environment variable from its key.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ getenv(var) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ getenv('VAR') }}</span></code></pre>
<h2 id="dump">dump<a class="heading-anchor" href="#dump" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">dump</code> function dumps information about a template variable. This is mostly useful to debug a template that does not behave as expected by introspecting its variables:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ <span class="hljs-name">dump</span><span class="hljs-params">(user)</span> }}</span></code></pre>
<aside class="note note-important"><p>The <a href="/configuration/site/#debug"><em>debug mode</em></a> must be enabled.</p></aside>
<h2 id="d">d<a class="heading-anchor" href="#d" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">d()</code> function is the HTML version of <a href="#dump"><code translate="no">dump()</code></a> and uses the <a href="https://symfony.com/doc/current/components/var_dumper.html" target="_blank" rel="noopener noreferrer">Symfony VarDumper Component</a> behind the scenes.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ d(variable, {theme: 'dark'}) }}</span></code></pre>
<ul>
<li>If <em>variable</em> is not provided, the function dumps the current Twig context</li>
<li>Available themes are <code translate="no">light</code> (default) and <code translate="no">dark</code></li>
</ul>
<aside class="note note-important"><p>The <a href="/configuration/site/#debug"><em>debug mode</em></a> must be enabled.</p></aside>
<h2 id="tests">Tests<a class="heading-anchor" href="#tests" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="https://twig.symfony.com/doc/tests/index.html" target="_blank" rel="noopener noreferrer">Tests</a> can be used with the <code translate="no">is</code> operator.</p>
<table>
<thead>
<tr>
<th>Test</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">asset</code></td>
<td>The variable is an <a href="/assets/#asset">asset</a>.</td>
</tr>
<tr>
<td><code translate="no">image_large</code></td>
<td>The asset is a landscape image of at least 600 × 315 pixels (e.g.: a cover image).</td>
</tr>
<tr>
<td><code translate="no">image_square</code></td>
<td>The asset is a square image (same width and height).</td>
</tr>
<tr>
<td><code translate="no">enabled</code></td>
<td>The option is enabled: <code translate="no">true</code>, a map without <code translate="no">enabled</code> key or with <code translate="no">enabled: true</code>, or any other value except <code translate="no">false</code> and <code translate="no">null</code>.</td>
</tr>
<tr>
<td><code translate="no">external</code></td>
<td>The URL (or the URL of a menu entry) is external: it has a scheme (<code translate="no">https:</code>, <code translate="no">mailto:</code>, etc.) or starts with <code translate="no">//</code>, and does not start with <code translate="no">baseurl</code>.</td>
</tr>
</tbody>
</table>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> image = asset(page.image) %}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> image is image_large %}</span><span class="xml">
  </span><span class="hljs-template-variable">{{ html(image, {alt: page.title}) }}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> config.cache is enabled %}</span><span class="xml">
  </span><span class="hljs-comment">{# `cache: false` and `cache: {enabled: false}` are both disabled #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> item in site.menus.main|sort_by_weight %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(item.url) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span></span></span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> item is external %}</span><span class="xml"><span class="hljs-tag"> <span class="hljs-attr">rel</span>=<span class="hljs-string">"noopener"</span> <span class="hljs-attr">target</span>=<span class="hljs-string">"_blank"</span></span></span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span><span class="xml"><span class="hljs-tag">&gt;</span></span><span class="hljs-template-variable">{{ item.name }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span></code></pre>
<aside class="note note-info"><p>The <code translate="no">enabled</code> test only checks the given value, not its parents: <code translate="no">config.optimize.html is enabled</code> can be true while <code translate="no">optimize</code> is disabled.
A custom option may not exist: use the <code translate="no">default</code> filter (e.g. <code translate="no">config.myoption|default(false) is enabled</code>).</p></aside>
<h2 id="deprecated">Deprecated<a class="heading-anchor" href="#deprecated" aria-hidden="true" tabindex="-1"></a></h2>
<p>The following functions are deprecated (a deprecation notice is triggered when they are used):</p>
<table>
<thead>
<tr>
<th>Function</th>
<th>Replacement</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">minify()</code></td>
<td><a href="/assets/processing/#minify"><code translate="no">minify</code></a> filter</td>
</tr>
<tr>
<td><code translate="no">toCSS()</code></td>
<td><a href="/assets/processing/#to-css"><code translate="no">to_css</code></a> filter</td>
</tr>
<tr>
<td><code translate="no">image_from_url()</code></td>
<td><a href="/assets/images/#image-from-website"><code translate="no">image_from_website()</code></a> function</td>
</tr>
</tbody>
</table>]]>
    </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-16T00: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>
<p>Cecil provides Twig filters to compile Sass, minify, fingerprint, inline or embed (as data URL) CSS and JavaScript assets.</p>
<h2 id="fingerprint">fingerprint<a class="heading-anchor" href="#fingerprint" aria-hidden="true" tabindex="-1"></a></h2>
<p>Adds a hash of the file content (fingerprint) to the file name.</p>
<pre data-lang="twig"><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>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|fingerprint }}</span></code></pre>
<h2 id="minify">minify<a class="heading-anchor" href="#minify" aria-hidden="true" tabindex="-1"></a></h2>
<p>Minifies a CSS or a JavaScript file.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|minify }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ path|minify }}</span></code></pre>
<p><em>Examples:</em></p>
<pre data-lang="twig"><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<a class="heading-anchor" href="#minify-css" aria-hidden="true" tabindex="-1"></a></h2>
<p>Minifies a CSS string.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|minify_css }}</span></code></pre>
<pre data-lang="twig"><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 data-lang="twig"><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 data-lang="twig"><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<a class="heading-anchor" href="#minify-js" aria-hidden="true" tabindex="-1"></a></h2>
<p>Minifies a JavaScript string.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|minify_js }}</span></code></pre>
<pre data-lang="twig"><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 data-lang="twig"><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 data-lang="twig"><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<a class="heading-anchor" href="#scss-to-css" aria-hidden="true" tabindex="-1"></a></h2>
<p>Compiles a <a href="https://sass-lang.com" target="_blank" rel="noopener noreferrer">Sass</a> string to CSS.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|scss_to_css }}</span></code></pre>
<pre data-lang="twig"><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 data-lang="twig"><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 data-lang="twig"><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<a class="heading-anchor" href="#to-css" aria-hidden="true" tabindex="-1"></a></h2>
<p>Compiles a <a href="https://sass-lang.com" target="_blank" rel="noopener noreferrer">Sass</a> file to CSS.</p>
<pre data-lang="twig"><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>Example:</em></p>
<pre data-lang="twig"><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<a class="heading-anchor" href="#inline" aria-hidden="true" tabindex="-1"></a></h2>
<p>Outputs the content of an <em>Asset</em>.</p>
<pre data-lang="twig"><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 data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|inline }}</span></code></pre>
<h2 id="dataurl">dataurl<a class="heading-anchor" href="#dataurl" aria-hidden="true" tabindex="-1"></a></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 (or of a path).</p>
<p>Raster images are re-encoded with the <a href="/configuration/assets/#assets-images"><code translate="no">assets.images.quality</code></a> option; other files (including SVG) are encoded as is in Base64.</p>
<pre data-lang="twig"><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">{{ path|dataurl }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><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">{{ asset('icon.png')|dataurl }}</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></code></pre>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/languages/</id>
    <title>Languages</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-04T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/languages/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Languages</h1>
<p>These options define the main language of the site and, for a multilingual website, its additional languages.</p>
<h2 id="language">language<a class="heading-anchor" href="#language" aria-hidden="true" tabindex="-1"></a></h2>
<p>The main language, defined by its code.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">language:</span> <span class="hljs-string">&lt;code&gt;</span> <span class="hljs-comment"># unique code (`en` by default)</span></code></pre>
<p>By default, only the paths of the other <a href="#languages">languages</a> pages are prefixed with their language code, but you can also prefix the paths of the main language pages with the following option:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-comment">#language: &lt;code&gt;</span>
<span class="hljs-attr">language:</span>
  <span class="hljs-attr">code:</span> <span class="hljs-string">&lt;code&gt;</span>
  <span class="hljs-attr">prefix:</span> <span class="hljs-literal">true</span></code></pre>
<aside class="note note-info"><p>When <code translate="no">prefix</code> is set to <code translate="no">true</code>, an alias is automatically created for the home page that redirects from <code translate="no">/</code> to <code translate="no">/&lt;code&gt;/</code>.</p></aside>
<h2 id="languages">languages<a class="heading-anchor" href="#languages" aria-hidden="true" tabindex="-1"></a></h2>
<p>Options of available languages, used for <a href="/content/multilingual/">pages</a> and <a href="/templates/localization/">templates</a> localization.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">languages:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">code:</span> <span class="hljs-string">&lt;code&gt;</span>          <span class="hljs-comment"># unique code, `xx` or `xx-XX` (required, e.g.: `en`, `fr`, `en-US`, `fr-CA`)</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">&lt;name&gt;</span>          <span class="hljs-comment"># human readable name (e.g.: `Français`)</span>
    <span class="hljs-attr">locale:</span> <span class="hljs-string">&lt;locale&gt;</span>      <span class="hljs-comment"># locale code (required, `language_COUNTRY`, e.g.: `en_US`, `fr_FR`, `fr_CA`)</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-string">&lt;true|false&gt;</span> <span class="hljs-comment"># enabled or not (`true` by default)</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">language:</span> <span class="hljs-string">en</span>
<span class="hljs-attr">languages:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">code:</span> <span class="hljs-string">en</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">English</span>
    <span class="hljs-attr">locale:</span> <span class="hljs-string">en_US</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">code:</span> <span class="hljs-string">fr</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">Français</span>
    <span class="hljs-attr">locale:</span> <span class="hljs-string">fr_FR</span></code></pre>
<aside class="note note-info"><p>A <a href="/documentation/locale-codes/">locale code list</a> is available if needed.</p></aside>
<h3 id="localize">Localize<a class="heading-anchor" href="#localize" aria-hidden="true" tabindex="-1"></a></h3>
<p>To localize configuration options you must store them under the <code translate="no">config</code> key of the language.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">title:</span> <span class="hljs-string">"Cecil in English"</span>
<span class="hljs-attr">languages:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">code:</span> <span class="hljs-string">en</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">English</span>
    <span class="hljs-attr">locale:</span> <span class="hljs-string">en_US</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">code:</span> <span class="hljs-string">fr</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">Français</span>
    <span class="hljs-attr">locale:</span> <span class="hljs-string">fr_FR</span>
    <span class="hljs-attr">config:</span>
      <span class="hljs-attr">title:</span> <span class="hljs-string">"Cecil en français"</span></code></pre>
<aside class="note note-info"><p>In <a href="/templates/">templates</a> you can access an option with <code translate="no">{{ site.&lt;option&gt; }}</code>, for example <code translate="no">{{ site.title }}</code>.<br>
If an option is not available in the current language (e.g.: <code translate="no">fr</code>), it falls back to the global one (e.g.: <code translate="no">en</code>).</p></aside>
<p>The localized options are validated like the global ones: the effective value of the language (the global value overridden by the localized one) must be valid.</p>
<p>Some options apply to the whole site and can't be localized: <code translate="no">language</code>, <code translate="no">languages</code>, <code translate="no">theme</code>, <code translate="no">cache</code>, <code translate="no">extensions</code>, <code translate="no">optimize</code>, <code translate="no">server</code>, <code translate="no">data</code>, <code translate="no">static</code>, <code translate="no">pages.dir</code>, <code translate="no">pages.ext</code>, <code translate="no">pages.frontmatter</code>, <code translate="no">pages.converter</code>, <code translate="no">pages.generators</code>, <code translate="no">pages.default</code>, <code translate="no">output.dir</code>, <code translate="no">output.formats</code>, <code translate="no">output.postprocessors</code>, <code translate="no">layouts.dir</code>, <code translate="no">layouts.extensions</code>, <code translate="no">layouts.autoescape</code> and <code translate="no">assets.dir</code>. They are ignored, with a warning, if they are set under the <code translate="no">config</code> key of a language.</p>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/content/front-matter/</id>
    <title>Front matter</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-14T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/content/front-matter/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Front matter</h1>
<p>The <em>front matter</em> can contain custom variables applied to the current page.</p>
<p>It must be the first thing in the file and must be valid <a href="https://en.wikipedia.org/wiki/YAML" target="_blank" rel="noopener noreferrer">YAML</a>.</p>
<aside class="note note-info"><p>YAML is the default format: you can use INI, TOML or JSON instead with the <a href="/configuration/pages/#pages-frontmatter"><code translate="no">pages.frontmatter</code></a> option.</p></aside>
<aside class="note note-tip"><p>The front matter is validated: the types of predefined variables are checked, and you can declare your own rules (required variables, types, allowed values, default values, etc.) by section or by page with the <a href="/configuration/pages/#pages-schema"><code translate="no">pages.schema</code></a> option.</p></aside>
<h2 id="predefined-variables">Predefined variables<a class="heading-anchor" href="#predefined-variables" aria-hidden="true" tabindex="-1"></a></h2>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
<th>Default value</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">title</code></td>
<td>Title</td>
<td>File name without extension, prefix and language suffix.</td>
<td><code translate="no">Post 1</code></td>
</tr>
<tr>
<td><code translate="no">layout</code></td>
<td>Template</td>
<td>See <a href="/templates/lookup-rules/#lookup-rules"><em>Lookup rules</em></a>.</td>
<td><code translate="no">404</code></td>
</tr>
<tr>
<td><code translate="no">date</code></td>
<td>Creation date</td>
<td>File modification date (PHP <em>DateTime</em> object).</td>
<td><code translate="no">2019-04-15</code></td>
</tr>
<tr>
<td><code translate="no">section</code></td>
<td>Section</td>
<td>Page's <em>Section</em>.</td>
<td><code translate="no">blog</code></td>
</tr>
<tr>
<td><code translate="no">path</code></td>
<td>Path</td>
<td>Page's <em>path</em>.</td>
<td><code translate="no">blog/post-1</code></td>
</tr>
<tr>
<td><code translate="no">slug</code></td>
<td>Slug</td>
<td>Page's <em>slug</em>.</td>
<td><code translate="no">post-1</code></td>
</tr>
<tr>
<td><code translate="no">weight</code></td>
<td>Sort order</td>
<td>File <a href="/documentation/pages/#weight">weight prefix</a>, if any.</td>
<td><code translate="no">10</code></td>
</tr>
<tr>
<td><code translate="no">language</code></td>
<td>Language code</td>
<td>File language suffix, or the main <a href="/configuration/languages/#language">language</a>.</td>
<td><code translate="no">fr</code></td>
</tr>
<tr>
<td><code translate="no">langref</code></td>
<td>Translations reference</td>
<td>Page's <em>path</em> (without language).</td>
<td><code translate="no">blog/post-1</code></td>
</tr>
<tr>
<td><code translate="no">published</code></td>
<td>Published or not</td>
<td><code translate="no">true</code>.</td>
<td><code translate="no">false</code></td>
</tr>
<tr>
<td><code translate="no">draft</code></td>
<td>Draft or not</td>
<td><code translate="no">false</code>.</td>
<td><code translate="no">true</code></td>
</tr>
</tbody>
</table>
<aside class="note note-info"><p>All the predefined variables can be overridden except <code translate="no">section</code>.</p></aside>
<aside class="note note-important"><p>The values of <code translate="no">path</code> and <code translate="no">slug</code> must already be slugified (e.g.: <code translate="no">my-post</code>, not <code translate="no">My Post</code>), otherwise the build fails.</p></aside>
<aside class="note note-tip"><p><code translate="no">draft: true</code> is the same as <code translate="no">published: false</code>. Unpublished pages can be previewed with the <code translate="no">--drafts</code> option of the <a href="/commands/build/"><code translate="no">build</code></a> and <a href="/commands/serve/"><code translate="no">serve</code></a> commands.</p></aside>
<h2 id="updated">updated<a class="heading-anchor" href="#updated" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">updated</code> variable is used to define the last modification date of a page.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">updated:</span> <span class="hljs-number">2026</span><span class="hljs-number">-02</span><span class="hljs-number">-02</span>
<span class="hljs-meta">---</span></code></pre>
<aside class="note note-info"><p><code translate="no">lastmod</code> is an alias of <code translate="no">updated</code>.</p></aside>
<aside class="note note-warning"><p>Before version 8.80.1, the <code translate="no">updated</code> variable was a predefined variable. It is now an optional variable (and must be defined in the front matter to be used).</p></aside>
<h2 id="menu">menu<a class="heading-anchor" href="#menu" aria-hidden="true" tabindex="-1"></a></h2>
<p>A page can be added to a <a href="/configuration/site/#menus">menu</a>.</p>
<p>The entry name is the page <code translate="no">title</code> and the URL is the page <code translate="no">path</code>.</p>
<p>The same page can be added to multiple menus, and each entry's position can be set with the <code translate="no">weight</code> key (lowest first). The <code translate="no">name</code> key can be used to override the default entry name per menu.</p>
<p><em>Examples:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">menu:</span> <span class="hljs-string">main</span>
<span class="hljs-meta">---</span></code></pre>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">menu:</span> <span class="hljs-string">[main,</span> <span class="hljs-string">navigation]</span> <span class="hljs-comment"># same page in multiple menus</span>
<span class="hljs-meta">---</span></code></pre>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">menu:</span>
  <span class="hljs-attr">main:</span>
    <span class="hljs-attr">weight:</span> <span class="hljs-number">10</span>
  <span class="hljs-attr">navigation:</span>
    <span class="hljs-attr">weight:</span> <span class="hljs-number">20</span>
<span class="hljs-meta">---</span></code></pre>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">title:</span> <span class="hljs-string">'Our Expertise'</span>
<span class="hljs-attr">menu:</span>
  <span class="hljs-attr">main:</span>
    <span class="hljs-attr">weight:</span> <span class="hljs-number">15</span>
  <span class="hljs-attr">footer:</span>
    <span class="hljs-attr">weight:</span> <span class="hljs-number">15</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">"Expertise"</span> <span class="hljs-comment"># override the entry name in this menu</span>
<span class="hljs-meta">---</span></code></pre>
<h2 id="taxonomy">Taxonomy<a class="heading-anchor" href="#taxonomy" aria-hidden="true" tabindex="-1"></a></h2>
<p>Taxonomy allows you to connect, relate and classify your website’s content.<br>
In Cecil, these terms are gathered within vocabularies.</p>
<p>Vocabularies are declared in the <a href="/configuration/site/#taxonomies"><em>Configuration</em></a>.</p>
<dl>
<dt>Vocabulary</dt>
<dd>A categorization of content (e.g.: <code translate="no">tags</code>, <code translate="no">categories</code>, etc.).</dd>
<dt>Term</dt>
<dd>A term is an item of a vocabulary (e.g.: <code translate="no">Development</code>, <code translate="no">PHP</code>, etc.).</dd>
</dl>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">tags:</span> <span class="hljs-string">["Development",</span> <span class="hljs-string">"PHP"</span><span class="hljs-string">]</span>
<span class="hljs-meta">---</span></code></pre>
<p>Cecil then generates, for each vocabulary:</p>
<ul>
<li>a page listing its terms, e.g.: <code translate="no">/tags/</code></li>
<li>a page per term listing its pages, e.g.: <code translate="no">/tags/development/</code> and <code translate="no">/tags/php/</code></li>
</ul>
<p>See <a href="/templates/lookup-rules/#type-vocabulary">templates lookup rules</a> and <a href="/templates/variables/#taxonomy">taxonomy variables</a> to customize those pages.</p>
<h2 id="schedule">Schedule<a class="heading-anchor" href="#schedule" aria-hidden="true" tabindex="-1"></a></h2>
<p>Schedules pages’ publication.</p>
<p><em>Example:</em></p>
<p>The page is published from 2023-02-07 (if the current date is &gt;= 2023-02-07):</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">schedule:</span>
  <span class="hljs-attr">publish:</span> <span class="hljs-number">2023</span><span class="hljs-number">-02</span><span class="hljs-number">-07</span>
<span class="hljs-meta">---</span></code></pre>
<p>The page is published until 2022-04-28 (if the current date is &lt; 2022-04-28, i.e. before midnight):</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">schedule:</span>
  <span class="hljs-attr">expiry:</span> <span class="hljs-number">2022</span><span class="hljs-number">-04</span><span class="hljs-number">-28</span>
<span class="hljs-meta">---</span></code></pre>
<p>Both can be combined: the page is published if the <code translate="no">publish</code> date is reached <strong>and</strong> the <code translate="no">expiry</code> date is not passed.</p>
<h2 id="redirect">redirect<a class="heading-anchor" href="#redirect" aria-hidden="true" tabindex="-1"></a></h2>
<p>As indicated by its name, the <code translate="no">redirect</code> variable is used to redirect a page to a dedicated URL.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">redirect:</span> <span class="hljs-string">"https://arnaudligny.fr"</span>
<span class="hljs-meta">---</span></code></pre>
<aside class="note note-info"><p>Redirect works with the <a href="https://github.com/Cecilapp/Cecil/blob/main/resources/layouts/_default/redirect.html.twig" target="_blank" rel="noopener noreferrer"><code translate="no">redirect.html.twig</code></a> template.</p></aside>
<h2 id="alias">alias<a class="heading-anchor" href="#alias" aria-hidden="true" tabindex="-1"></a></h2>
<p>An alias is a redirection to the current page.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">title:</span> <span class="hljs-string">"About"</span>
<span class="hljs-attr">alias:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-string">contact</span>
<span class="hljs-meta">---</span></code></pre>
<p>In the previous example <code translate="no">contact/</code> redirects to <code translate="no">about/</code>.</p>
<aside class="note note-info"><p><code translate="no">aliases</code> is still supported for backward compatibility.</p></aside>
<h2 id="output">output<a class="heading-anchor" href="#output" aria-hidden="true" tabindex="-1"></a></h2>
<p>Defines the output format of the page.</p>
<p>Available formats are: <code translate="no">html</code>, <code translate="no">atom</code>, <code translate="no">rss</code>, <code translate="no">json</code>, <code translate="no">xml</code>, etc.<br>
You can define one or more formats in an array.</p>
<p>It’s not required to define an output format, but if you do, it must be one of the available formats defined in the <a href="/configuration/output/#output-formats"><em>Configuration</em></a>.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">output:</span> <span class="hljs-string">[html,</span> <span class="hljs-string">atom]</span>
<span class="hljs-meta">---</span></code></pre>
<h2 id="uglyurl">uglyurl<a class="heading-anchor" href="#uglyurl" aria-hidden="true" tabindex="-1"></a></h2>
<p>Set <code translate="no">uglyurl</code> to <code translate="no">true</code> to publish the page as a file named after its path (e.g.: <code translate="no">blog/post-1.html</code>) instead of an <code translate="no">index.html</code> file in a folder (e.g.: <code translate="no">blog/post-1/index.html</code>).</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">uglyurl:</span> <span class="hljs-literal">true</span>
<span class="hljs-meta">---</span></code></pre>
<h2 id="external">external<a class="heading-anchor" href="#external" aria-hidden="true" tabindex="-1"></a></h2>
<p>A page with an <code translate="no">external</code> variable tries to fetch the content of the pointed resource, and uses it as the page body.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">external:</span> <span class="hljs-string">"https://raw.githubusercontent.com/Cecilapp/Cecil/main/README.md"</span>
<span class="hljs-meta">---</span></code></pre>
<h2 id="excluded">excluded<a class="heading-anchor" href="#excluded" aria-hidden="true" tabindex="-1"></a></h2>
<p>Set <code translate="no">excluded</code> to <code translate="no">true</code> to hide a page from list pages (e.g.: <em>Home page</em>, <em>Section</em>, <em>Sitemap</em>, etc.).</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">excluded:</span> <span class="hljs-literal">true</span>
<span class="hljs-meta">---</span></code></pre>
<aside class="note note-info"><p><code translate="no">excluded</code> is different from <a href="#predefined-variables"><code translate="no">published</code></a>: an excluded page is published but hidden from list pages.</p></aside>
<aside class="note note-warning"><p>Since version 8.49.0, the previous <code translate="no">exclude</code> variable has been renamed <code translate="no">excluded</code> (<code translate="no">exclude</code> is still supported for backward compatibility).</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/variables/</id>
    <title>Variables</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-19T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/variables/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Variables</h1>
<blockquote>
<p>The application passes variables to the templates for manipulation in the template. Variables may have attributes or elements you can access, too.<br>
Use a dot (.) to access attributes of a variable: <code translate="no">{{ foo.bar }}</code></p>
</blockquote>
<p>You can use variables from different scopes: <a href="#site"><code translate="no">site</code></a>, <a href="#page"><code translate="no">page</code></a>, <a href="#cecil"><code translate="no">cecil</code></a>.</p>
<h2 id="site">site<a class="heading-anchor" href="#site" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">site</code> variable contains built-in variables <strong>and</strong> those set in the <a href="/configuration/">configuration</a>.</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">site.pages</code></td>
<td>Collection of all pages, in the current language.</td>
</tr>
<tr>
<td><code translate="no">site.allpages</code></td>
<td>Collection of all pages, in all languages.</td>
</tr>
<tr>
<td><code translate="no">site.page(id)</code></td>
<td>A page with the given ID.</td>
</tr>
<tr>
<td><code translate="no">site.taxonomies</code></td>
<td>Collection of vocabularies.</td>
</tr>
<tr>
<td><code translate="no">site.home</code></td>
<td>ID of the home page.</td>
</tr>
<tr>
<td><code translate="no">site.time</code></td>
<td>Current <a href="https://wikipedia.org/wiki/Unix_time" target="_blank" rel="noopener noreferrer"><em>Timestamp</em></a>.</td>
</tr>
<tr>
<td><code translate="no">site.debug</code></td>
<td>Debug mode status (<code translate="no">true</code> or <code translate="no">false</code>).</td>
</tr>
<tr>
<td><code translate="no">site.build</code></td>
<td>Current build ID.</td>
</tr>
</tbody>
</table>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">title:</span> <span class="hljs-string">"My amazing website!"</span></code></pre>
<p>Can be displayed in a template with:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ site.title }}</span></code></pre>
<aside class="note note-important"><p>Use <code translate="no">showable</code> method on pages collection to return only published and not <em>paginated/redirect/excluded</em> pages (generated pages, such as sections or taxonomies, are included).</p>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> page in site.pages.showable %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ page.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span></code></pre></aside>
<aside class="note note-warning"><p>In some cases, you can encounter conflicts between configuration and built-in variables (e.g. <code translate="no">pages.default</code> configuration). In that case, you can use <code translate="no">config.&lt;variable&gt;</code> (where <code translate="no">&lt;variable&gt;</code> is the variable name/path) to access the raw configuration directly.</p>
<p>Example:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ config.pages.default.sitemap.priority }}</span></code></pre></aside>
<h3 id="site-menus">site.menus<a class="heading-anchor" href="#site-menus" aria-hidden="true" tabindex="-1"></a></h3>
<p>Loop on <code translate="no">site.menus.&lt;menu&gt;</code> to get each entry of the <code translate="no">&lt;menu&gt;</code> collection (e.g.: <code translate="no">main</code>).</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">&lt;entry&gt;.id</code></td>
<td>Entry ID (for a page entry: the page ID without language prefix).</td>
</tr>
<tr>
<td><code translate="no">&lt;entry&gt;.name</code></td>
<td>Entry name.</td>
</tr>
<tr>
<td><code translate="no">&lt;entry&gt;.url</code></td>
<td>Entry URL.</td>
</tr>
<tr>
<td><code translate="no">&lt;entry&gt;.weight</code></td>
<td>Entry weight (useful to sort menu entries).</td>
</tr>
</tbody>
</table>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">ol</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> entry in site.menus.main|sort_by_weight %}</span><span class="xml">
    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(entry.url) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">data-weight</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ entry.weight }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ entry.name }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
  <span class="hljs-tag">&lt;/<span class="hljs-name">ol</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span></span></code></pre>
<h3 id="site-language">site.language<a class="heading-anchor" href="#site-language" aria-hidden="true" tabindex="-1"></a></h3>
<p>Information about the current language.</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">site.language</code></td>
<td>Language code (e.g.: <code translate="no">en</code>).</td>
</tr>
<tr>
<td><code translate="no">site.language.name</code></td>
<td>Language name (e.g.: <code translate="no">English</code>).</td>
</tr>
<tr>
<td><code translate="no">site.language.locale</code></td>
<td>Language <a href="/configuration/locale-codes/">locale code</a> (e.g.: <code translate="no">en_US</code>).</td>
</tr>
<tr>
<td><code translate="no">site.language.weight</code></td>
<td>Language position in the <code translate="no">languages</code> list.</td>
</tr>
</tbody>
</table>
<aside class="note note-tip"><p>You can retrieve <code translate="no">name</code>, <code translate="no">locale</code> and <code translate="no">weight</code> of a specific language by passing its code as a parameter.<br>
e.g.: <code translate="no">site.language.name('fr')</code>.</p></aside>
<h3 id="site-static">site.static<a class="heading-anchor" href="#site-static" aria-hidden="true" tabindex="-1"></a></h3>
<p>The static files collection can be accessed via <code translate="no">site.static</code> if the <a href="/configuration/data-static/#static-load"><em>static load</em></a> is enabled.</p>
<p>Each file exposes the following properties:</p>
<ul>
<li><code translate="no">file</code>: relative file path, as found in the <code translate="no">static/</code> directory (e.g.: <code translate="no">images/img-1.jpg</code>)</li>
<li><code translate="no">path</code>: relative path, with forward slashes (e.g.: <code translate="no">images/img-1.jpg</code>)</li>
<li><code translate="no">date</code>: creation date (<em>DateTime</em>)</li>
<li><code translate="no">updated</code>: modification date (<em>DateTime</em>)</li>
<li><code translate="no">name</code>: name (e.g.: <code translate="no">img-1.jpg</code>)</li>
<li><code translate="no">basename</code>: name without extension (e.g.: <code translate="no">img-1</code>)</li>
<li><code translate="no">ext</code>: extension (e.g.: <code translate="no">jpg</code>)</li>
<li><code translate="no">type</code>: media type (e.g.: <code translate="no">image</code>)</li>
<li><code translate="no">subtype</code>: media sub type (e.g.: <code translate="no">image/jpeg</code>)</li>
<li><code translate="no">exif</code>: image EXIF data (<em>array</em>)</li>
<li><code translate="no">audio</code>: <a href="https://github.com/wapmorgan/Mp3Info#audio-information" target="_blank" rel="noopener noreferrer">Mp3Info</a> object</li>
<li><code translate="no">video</code>: array of basic video information (duration in seconds, width and height)</li>
</ul>
<h3 id="site-data">site.data<a class="heading-anchor" href="#site-data" aria-hidden="true" tabindex="-1"></a></h3>
<p>A data collection can be accessed via <code translate="no">site.data.&lt;filename&gt;</code> (without file extension).</p>
<p><em>Examples:</em></p>
<ul>
<li><code translate="no">data/authors.yml</code> : <code translate="no">site.data.authors</code></li>
<li><code translate="no">data/authors.fr.yml</code> : <code translate="no">site.data.authors</code> (if <code translate="no">site.language</code> = "fr")</li>
<li><code translate="no">data/galleries/gallery-1.json</code> : <code translate="no">site.data.galleries['gallery-1']</code></li>
</ul>
<h2 id="page">page<a class="heading-anchor" href="#page" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">page</code> variable contains built-in variables of a page <strong>and</strong> those set in the <a href="/content/pages/#front-matter">front matter</a>.</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">page.id</code></td>
<td>Unique identifier.</td>
<td><code translate="no">blog/post-1</code></td>
</tr>
<tr>
<td><code translate="no">page.title</code></td>
<td>File name (without extension).</td>
<td><code translate="no">Post 1</code></td>
</tr>
<tr>
<td><code translate="no">page.date</code></td>
<td>File creation date.</td>
<td><em>DateTime</em></td>
</tr>
<tr>
<td><code translate="no">page.body</code></td>
<td>File body.</td>
<td><em>Markdown</em></td>
</tr>
<tr>
<td><code translate="no">page.content</code></td>
<td>File body converted in HTML.</td>
<td><em>HTML</em></td>
</tr>
<tr>
<td><code translate="no">page.section</code></td>
<td>File root folder (<em>slugified</em>).</td>
<td><code translate="no">blog</code></td>
</tr>
<tr>
<td><code translate="no">page.path</code></td>
<td>File path (<em>slugified</em>).</td>
<td><code translate="no">blog/post-1</code></td>
</tr>
<tr>
<td><code translate="no">page.slug</code></td>
<td>File name (<em>slugified</em>).</td>
<td><code translate="no">post-1</code></td>
</tr>
<tr>
<td><code translate="no">page.filepath</code></td>
<td>File system path.</td>
<td><code translate="no">Blog/Post 1.md</code></td>
</tr>
<tr>
<td><code translate="no">page.type</code></td>
<td><code translate="no">homepage</code>, <code translate="no">page</code>, <code translate="no">section</code>, <code translate="no">vocabulary</code> or <code translate="no">term</code>.</td>
<td><code translate="no">page</code></td>
</tr>
<tr>
<td><code translate="no">page.pages</code></td>
<td>Collection of all sub pages.</td>
<td><em>Collection</em></td>
</tr>
<tr>
<td><code translate="no">page.translations</code></td>
<td>Collection of translated pages.</td>
<td><em>Collection</em></td>
</tr>
</tbody>
</table>
<aside class="note note-important"><p>Use <code translate="no">showable</code> method on pages collection to return only published and not <em>paginated/redirect/excluded</em> pages (generated pages, such as sections or taxonomies, are included).</p>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> page in page.pages.showable %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ page.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span></code></pre></aside>
<h3 id="nested-sections">Nested sections<a class="heading-anchor" href="#nested-sections" aria-hidden="true" tabindex="-1"></a></h3>
<p>In a <a href="/content/pages/#sub-section">nested sections</a> context, <code translate="no">page.parent</code>, <code translate="no">page.ancestors</code>, <code translate="no">page.sections</code> and <code translate="no">page.toplevel</code> help you build navigation.</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">page.parent</code></td>
<td>Parent <em>section</em>'s page (<code translate="no">null</code> if none).</td>
<td><em>Page</em></td>
</tr>
<tr>
<td><code translate="no">page.ancestors</code></td>
<td>Collection of ancestor <em>sections</em> (nearest first).</td>
<td><em>Collection</em></td>
</tr>
<tr>
<td><code translate="no">page.sections</code></td>
<td>Collection of immediate descendant <em>sections</em>.</td>
<td><em>Collection</em></td>
</tr>
<tr>
<td><code translate="no">page.toplevel</code></td>
<td><code translate="no">true</code> if the page is a top level <em>section</em>.</td>
<td><em>Boolean</em></td>
</tr>
</tbody>
</table>
<p><em>Breadcrumb (from the home page to the current page):</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">"breadcrumb"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(site.home) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ site.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
    </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> section in page.ancestors|<span class="hljs-keyword">reverse</span> %}</span><span class="xml">
    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(section) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ section.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
    </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
    </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.id != site.home %}</span><span class="xml">
    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">aria-current</span>=<span class="hljs-string">"page"</span>&gt;</span></span><span class="hljs-template-variable">{{ page.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
    </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span><span class="xml">
  <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span></span></code></pre>
<aside class="note note-tip"><p>A ready-to-use <a href="https://github.com/Cecilapp/Cecil/blob/main/resources/layouts/partials/breadcrumb.html.twig" target="_blank" rel="noopener noreferrer"><code translate="no">breadcrumb.html.twig</code></a> partial is available:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ <span class="hljs-name">include</span><span class="hljs-params">('partials/breadcrumb.html.twig')</span> }}</span></code></pre></aside>
<p><em>Sub-sections menu (immediate descendant sections of the current section):</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.sections|<span class="hljs-keyword">length</span> %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> section in page.sections|sort_by_title %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(section) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ section.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<p><em>Main navigation limited to top level sections (from any page):</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> section in site.page(site.home).sections|sort_by_title %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(section) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ section.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span></span></code></pre>
<p><em>Link to the parent section:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.<span class="hljs-name">parent</span> %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page.<span class="hljs-name">parent</span>) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>← </span><span class="hljs-template-variable">{{ page.<span class="hljs-name">parent</span>.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<h3 id="page-prev-next">page.&lt;prev/next&gt;<a class="heading-anchor" href="#page-prev-next" aria-hidden="true" tabindex="-1"></a></h3>
<p>Navigation between pages within the same <em>section</em>, sorted according to the section's <code translate="no">sortby</code> (chronological order for dates).</p>
<p>With <a href="/content/pages/#sub-section">sub-sections</a>, navigation follows the sections tree: the pages of a top level <em>Section</em> and of all its sub-sections are chained, each sub-section (its index page) being placed among the pages of its parent <em>Section</em> and followed by its own pages.</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">page.prev</code></td>
<td>Previous page.</td>
<td><em>Page</em></td>
</tr>
<tr>
<td><code translate="no">page.next</code></td>
<td>Next page.</td>
<td><em>Page</em></td>
</tr>
</tbody>
</table>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.prev is defined %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page.prev) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ page.prev.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<h3 id="page-paginator">page.paginator<a class="heading-anchor" href="#page-paginator" aria-hidden="true" tabindex="-1"></a></h3>
<p><em>Paginator</em> helps you build navigation for list pages: homepage, sections, and taxonomies.</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">page.paginator.pages</code></td>
<td>Pages Collection.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.pages_total</code></td>
<td>Total number of pages.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.count</code></td>
<td>Number of paginator's pages.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.current</code></td>
<td>Position index of the current page.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.links.first</code></td>
<td>Page ID of the first page.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.links.prev</code></td>
<td>Page ID of the previous page.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.links.self</code></td>
<td>Page ID of the current page.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.links.next</code></td>
<td>Page ID of the next page.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.links.last</code></td>
<td>Page ID of the last page.</td>
</tr>
<tr>
<td><code translate="no">page.paginator.links.path</code></td>
<td>Page ID without the position index.</td>
</tr>
</tbody>
</table>
<aside class="note note-important"><p>Because links entries are Page ID you must use the <code translate="no">url()</code> function to create working links.<br>
e.g.: <code translate="no">{{ url(page.paginator.links.next) }}</code></p></aside>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.paginator %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.paginator.links.prev is defined %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page.paginator.links.prev) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>Previous<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span><span class="xml">
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.paginator.links.next is defined %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page.paginator.links.next) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>Next<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> page.paginator %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> paginator_index in 1..page.paginator.count %}</span><span class="xml">
    </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> paginator_index != page.paginator.current %}</span><span class="xml">
      </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> paginator_index == 1 %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page.paginator.links.first) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ paginator_index }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
      </span><span class="hljs-template-tag">{% <span class="hljs-name">else</span> %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page.paginator.links.path ~ '/' ~ paginator_index) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ paginator_index }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
      </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span><span class="xml">
    </span><span class="hljs-template-tag">{% <span class="hljs-name">else</span> %}</span><span class="xml">
  </span><span class="hljs-template-variable">{{ paginator_index }}</span><span class="xml">
    </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span><span class="xml">
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<h3 id="taxonomy">Taxonomy<a class="heading-anchor" href="#taxonomy" aria-hidden="true" tabindex="-1"></a></h3>
<p>Variables available in <em>vocabulary</em> and <em>term</em> templates.</p>
<h4 id="vocabulary">Vocabulary</h4>
<p>Page <code translate="no">/&lt;plural&gt;/</code> (e.g.: <code translate="no">/categories/</code>).</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">page.plural</code></td>
<td>Vocabulary name in plural form.</td>
</tr>
<tr>
<td><code translate="no">page.singular</code></td>
<td>Vocabulary name in singular form.</td>
</tr>
<tr>
<td><code translate="no">page.terms</code></td>
<td>List of terms (<em>Collection</em>).</td>
</tr>
</tbody>
</table>
<p>Each term of <code translate="no">page.terms</code> provides <code translate="no">term.id</code> (term ID, e.g.: <code translate="no">categories/php</code>), <code translate="no">term.name</code> (term name, e.g.: <code translate="no">PHP</code>) and the number of its pages with <code translate="no">term|length</code>.</p>
<h4 id="term">Term</h4>
<p>Page <code translate="no">/&lt;plural&gt;/&lt;term&gt;/</code> (e.g.: <code translate="no">/categories/php/</code>).</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">page.title</code></td>
<td>Term name.</td>
</tr>
<tr>
<td><code translate="no">page.term</code></td>
<td>Term ID (e.g.: <code translate="no">categories/php</code>).</td>
</tr>
<tr>
<td><code translate="no">page.plural</code></td>
<td>Vocabulary name in plural form.</td>
</tr>
<tr>
<td><code translate="no">page.singular</code></td>
<td>Vocabulary name in singular form.</td>
</tr>
<tr>
<td><code translate="no">page.pages</code></td>
<td>List of pages in this term, sorted by date (<em>Collection</em>).</td>
</tr>
</tbody>
</table>
<h4 id="taxonomy-example">Taxonomy example</h4>
<p>Configuration:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">taxonomies:</span>
  <span class="hljs-attr">categories:</span> <span class="hljs-string">category</span></code></pre>
<p>Page front matter:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">categories:</span> <span class="hljs-string">["Data</span> <span class="hljs-string">Sovereignty"]</span>
<span class="hljs-meta">---</span></code></pre>
<p>List of terms (<code translate="no">/categories/</code>), in <code translate="no">layouts/taxonomy/categories.html.twig</code>:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">extends</span></span> 'page.html.twig' %}</span><span class="xml">

</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">block</span></span> content %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span></span><span class="hljs-template-variable">{{ page.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> term in page.terms %}</span><span class="xml">
    <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(term.id) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ term.name }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span> (</span><span class="hljs-template-variable">{{ term|<span class="hljs-keyword">length</span> }}</span><span class="xml">)<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
  <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endblock</span></span> %}</span></code></pre>
<p>List of pages of a term (<code translate="no">/categories/data-sovereignty/</code>), in <code translate="no">layouts/taxonomy/category.html.twig</code>:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">extends</span></span> 'page.html.twig' %}</span><span class="xml">

</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">block</span></span> content %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span></span><span class="hljs-template-variable">{{ page.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> p in page.paginator.pages ?? page.pages %}</span><span class="xml">
    <span class="hljs-tag">&lt;<span class="hljs-name">article</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(p) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ p.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">article</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(page.plural) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>All </span><span class="hljs-template-variable">{{ page.plural }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endblock</span></span> %}</span></code></pre>
<p>Links to the terms of the current page, in a page template:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> category in page.categories ?? [] %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url('categories/' ~ category) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ category }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span></code></pre>
<aside class="note note-tip"><p>The <a href="/documentation/reference/functions/#url"><code translate="no">url()</code></a> function slugifies the given string to find the matching page: <code translate="no">url('categories/Data Sovereignty')</code> returns <code translate="no">/categories/data-sovereignty/</code>.</p>
<p>You can also use the built-in partial <code translate="no">{{ include('partials/terms-list.html.twig', {vocabulary: 'categories'}) }}</code>.</p></aside>
<h2 id="cecil">cecil<a class="heading-anchor" href="#cecil" aria-hidden="true" tabindex="-1"></a></h2>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">cecil.url</code></td>
<td>URL of the Cecil website.</td>
</tr>
<tr>
<td><code translate="no">cecil.version</code></td>
<td>Cecil current version.</td>
</tr>
<tr>
<td><code translate="no">cecil.poweredby</code></td>
<td>Prints <code translate="no">Cecil v%s</code>, where <code translate="no">%s</code> is the current version.</td>
</tr>
</tbody>
</table>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/reference/sorts/</id>
    <title>Sorts</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/reference/sorts/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Sorts</h1>
<p>Sorting collections (of pages, menus or taxonomies).</p>
<h2 id="sort-by-title">sort_by_title<a class="heading-anchor" href="#sort-by-title" aria-hidden="true" tabindex="-1"></a></h2>
<p>Sorts a collection by title (with <a href="https://en.wikipedia.org/wiki/Natural_sort_order" target="_blank" rel="noopener noreferrer">natural sort</a>).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ collection|sort_by_title }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ site.pages|sort_by_title }}</span></code></pre>
<h2 id="sort-by-date">sort_by_date<a class="heading-anchor" href="#sort-by-date" aria-hidden="true" tabindex="-1"></a></h2>
<p>Sorts a collection by date (most recent first).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ collection|sort_by_date(variable='<span class="hljs-name">date</span>', desc_title=false) }}</span></code></pre>
<ul>
<li><code translate="no">variable</code>: the date variable to sort by (<code translate="no">date</code> by default)</li>
<li><code translate="no">desc_title</code>: sorts items with the same date by title, in descending order (<code translate="no">false</code> by default)</li>
</ul>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# sort by date #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ site.pages|sort_by_date }}</span><span class="xml">
</span><span class="hljs-comment">{# sort by updated variable instead of date #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ site.pages|sort_by_date(variable='updated') }}</span><span class="xml">
</span><span class="hljs-comment">{# sort items with the same date by desc title #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ site.pages|sort_by_date(desc_title=true) }}</span><span class="xml">
</span><span class="hljs-comment">{# reverse sort #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ site.pages|sort_by_date|<span class="hljs-keyword">reverse</span> }}</span></code></pre>
<h2 id="sort-by-weight">sort_by_weight<a class="heading-anchor" href="#sort-by-weight" aria-hidden="true" tabindex="-1"></a></h2>
<p>Sorts a collection by weight (lighter first).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ collection|sort_by_weight }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ site.menus.main|sort_by_weight }}</span></code></pre>
<h2 id="sort">sort<a class="heading-anchor" href="#sort" aria-hidden="true" tabindex="-1"></a></h2>
<p>For more complex cases, you should use <a href="https://twig.symfony.com/doc/filters/sort.html" target="_blank" rel="noopener noreferrer">Twig’s native <code translate="no">sort</code></a>.</p>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> files = site.static|<span class="hljs-keyword">sort</span>((a, b) =&gt; b.<span class="hljs-name">date</span> &lt;=&gt; a.<span class="hljs-name">date</span>) %}</span></code></pre>
<h2 id="collection-methods">Collection methods<a class="heading-anchor" href="#collection-methods" aria-hidden="true" tabindex="-1"></a></h2>
<p>A pages collection (e.g.: <code translate="no">site.pages</code>, <code translate="no">page.pages</code>) also provides sorting methods, which return a pages collection:</p>
<ul>
<li><code translate="no">sortBy(options)</code>: sorts by <code translate="no">date</code>, <code translate="no">updated</code>, <code translate="no">title</code> or <code translate="no">weight</code></li>
<li><code translate="no">sortByDate(options)</code>, <code translate="no">sortByTitle(options)</code>, <code translate="no">sortByWeight(options)</code></li>
</ul>
<p><code translate="no">options</code> can be the name of the variable (e.g.: <code translate="no">'title'</code>) or an object with the keys <code translate="no">variable</code>, <code translate="no">descTitle</code> (sort by date only) and <code translate="no">reverse</code>.</p>
<p><em>Examples:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> p in site.pages.showable.sortBy('title') %}</span><span class="xml">…</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> p in site.pages.showable.sortBy({variable: 'updated', reverse: true}) %}</span><span class="xml">…</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span></code></pre>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/content/markdown/</id>
    <title>Markdown</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-24T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/content/markdown/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Markdown</h1>
<p>Cecil supports <a href="https://daringfireball.net/projects/markdown/syntax" target="_blank" rel="noopener noreferrer">Markdown</a> format, but also <a href="https://michelf.ca/projects/php-markdown/extra/" target="_blank" rel="noopener noreferrer">Markdown Extra</a>.</p>
<p>Cecil also provides <strong>extra features</strong> to enhance your content, see below.</p>
<h2 id="attributes">Attributes<a class="heading-anchor" href="#attributes" aria-hidden="true" tabindex="-1"></a></h2>
<p>With <a href="https://michelf.ca/projects/php-markdown/extra/" target="_blank" rel="noopener noreferrer">Markdown Extra</a> you can set an id, class and custom attributes on certain elements using an attribute block.<br>
For instance, put the desired attribute(s) after a heading, a fenced code block, a link or an image at the end of the line inside curly brackets, like this:</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no"><span class="hljs-section">## Header {#id .class attribute=value}</span></code></pre>
<aside class="note note-warning"><p>For an inline element, like a link, you must use a line break after the closing brace:</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">Lorem ipsum [<span class="hljs-string">dolor</span>](<span class="hljs-link">url</span>){attribute=value} 
sit amet.</code></pre></aside>
<h2 id="links">Links<a class="heading-anchor" href="#links" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can create a link with the syntax <code translate="no">[Text](url)</code>, where <code translate="no">url</code> can be a path, a relative path to a Markdown file, an external URL, etc.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">[<span class="hljs-string">Link to a path</span>](<span class="hljs-link">/about/</span>)
[<span class="hljs-string">Link to a Markdown file</span>](<span class="hljs-link">about.md</span>)
[<span class="hljs-string">Link to Cecil website</span>](<span class="hljs-link">https://cecil.app</span>)</code></pre>
<aside class="note note-info"><p>A relative link to a Markdown file is resolved from the folder of the current file (as on GitHub), then replaced by the URL of the targeted page.</p></aside>
<h3 id="link-to-a-page">Link to a page<a class="heading-anchor" href="#link-to-a-page" aria-hidden="true" tabindex="-1"></a></h3>
<p>You can easily create a link to a page with the syntax <code translate="no">[Page title](page:page-id)</code>.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">[<span class="hljs-string">Link to a blog post</span>](<span class="hljs-link">page:blog/post-1</span>)</code></pre>
<h3 id="external">External<a class="heading-anchor" href="#external" aria-hidden="true" tabindex="-1"></a></h3>
<p>By default external links have the following value for <code translate="no">rel</code> attribute: <code translate="no">noopener noreferrer</code>.</p>
<aside class="note note-info"><p>A link is considered external if its URL starts with <code translate="no">http</code> but not with the <a href="/configuration/site/#baseurl"><code translate="no">baseurl</code></a>: <code translate="no">baseurl</code> must be defined.</p></aside>
<p><em>Example:</em></p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"&lt;url&gt;"</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"noopener noreferrer"</span>&gt;</span>Link to another website<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span></code></pre>
<p>You can change this behavior with <a href="/configuration/pages/#pages-body-links"><code translate="no">pages.body.links.external</code> options</a>.</p>
<h3 id="embedded-links">Embedded links<a class="heading-anchor" href="#embedded-links" aria-hidden="true" tabindex="-1"></a></h3>
<p>Cecil can try to turn a link into embedded content by using the <code translate="no">{embed}</code> attribute or by setting the global configuration option <code translate="no">pages.body.links.embed.enabled</code> to <code translate="no">true</code>.</p>
<aside class="note note-important"><p>Only <strong>YouTube</strong>, <strong>Vimeo</strong>, <strong>Dailymotion</strong>, and <strong>GitHub Gists</strong> links are supported.</p></aside>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">[<span class="hljs-string">CECIL : LE générateur de SITES STATIQUES en PHP</span>](<span class="hljs-link">https://www.youtube.com/watch?v=ur8koU0iYvc</span>){embed}</code></pre>
<p><div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
<iframe src="https://www.youtube-nocookie.com/embed/ur8koU0iYvc" loading="lazy" width="640" height="360" title="CECIL : LE générateur de SITES STATIQUES en PHP" frameborder="0" allow="accelerometer;autoplay;encrypted-media;gyroscope;picture-in-picture;fullscreen;web-share;" allowfullscreen="" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;background-color:#d8d8d8;"></iframe>
</div></p>
<h4 id="local-video-audio-files">Local video/audio files</h4>
<p>Cecil can also create <code translate="no">&lt;video&gt;</code> and <code translate="no">&lt;audio&gt;</code> HTML elements, based on the file extension (<code translate="no">mp4</code> and <code translate="no">webm</code> for video, <code translate="no">mp3</code>, <code translate="no">ogg</code> and <code translate="no">wav</code> for audio, see <a href="/configuration/pages/#pages-body-links"><code translate="no">pages.body.links.embed</code></a>).</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">[<span class="hljs-string">Video file</span>](<span class="hljs-link">video.mp4</span>){embed controls poster=/images/video-test.png}
[<span class="hljs-string">Audio file</span>](<span class="hljs-link">song.mp3</span>){embed controls}</code></pre>
<p>Is converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">video</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/video.mp4"</span> <span class="hljs-attr">controls</span> <span class="hljs-attr">poster</span>=<span class="hljs-string">"/images/video-test.png"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"max-width:100%;height:auto;background-color:#d8d8d8;"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">video</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">audio</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/song.mp3"</span> <span class="hljs-attr">controls</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">audio</span>&gt;</span></code></pre>
<aside class="note note-info"><p>Without the <code translate="no">controls</code> attribute, a video gets the <code translate="no">autoplay</code>, <code translate="no">loop</code>, <code translate="no">muted</code> and <code translate="no">playsinline</code> attributes.</p></aside>
<p>With <code translate="no">{embed=false}</code> (or when embedding is disabled), a local video/audio file stays a link, but its URL points to the published file (fingerprinted if <a href="/configuration/assets/"><code translate="no">assets.fingerprint</code></a> is enabled).</p>
<h2 id="images">Images<a class="heading-anchor" href="#images" aria-hidden="true" tabindex="-1"></a></h2>
<p>To add an image, use an exclamation mark (<code translate="no">!</code>) followed by an alternative description in brackets (<code translate="no">[]</code>), and the path or URL to the image in parentheses (<code translate="no">()</code>).<br>
You can optionally add a title in quotation marks.</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![<span class="hljs-string">Alternative description</span>](<span class="hljs-link">/image.jpg "Image title"</span>)</code></pre>
<aside class="note note-info"><p>The path should be relative to the root of your website (e.g.: <code translate="no">/image.jpg</code>), however Cecil is able to normalize a path relative to <em>assets</em> and <em>static</em> directories (e.g.: <code translate="no">../../assets/image.jpg</code>).</p></aside>
<aside class="note note-info"><p>Remote images (e.g.: <code translate="no">https://example.com/image.jpg</code>) are downloaded and handled as <em>Assets</em>, so they can be resized and converted. You can disable this behavior, or define a fallback image, with the <a href="/configuration/pages/#pages-body-images"><code translate="no">remote</code> option</a>.</p></aside>
<h3 id="lazy-loading">Lazy loading<a class="heading-anchor" href="#lazy-loading" aria-hidden="true" tabindex="-1"></a></h3>
<p>Cecil adds the attribute <code translate="no">loading="lazy"</code> to each image.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/image.jpg)</code></pre>
<p>Is converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/image.jpg"</span> <span class="hljs-attr">loading</span>=<span class="hljs-string">"lazy"</span>&gt;</span></code></pre>
<aside class="note note-info"><p>You can disable this behavior with the attribute <code translate="no">{loading=eager}</code> or with the <a href="/configuration/pages/#pages-body-images"><code translate="no">lazy</code> option</a>.</p></aside>
<h3 id="decoding">Decoding<a class="heading-anchor" href="#decoding" aria-hidden="true" tabindex="-1"></a></h3>
<p>Cecil adds the attribute <code translate="no">decoding="async"</code> to each image.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/image.jpg)</code></pre>
<p>Is converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/image.jpg"</span> <span class="hljs-attr">decoding</span>=<span class="hljs-string">"async"</span>&gt;</span></code></pre>
<aside class="note note-info"><p>You can disable this behavior with the attribute <code translate="no">{decoding=auto}</code> or with the <a href="/configuration/pages/#pages-body-images"><code translate="no">decoding</code> option</a>.</p></aside>
<h3 id="resize">Resize<a class="heading-anchor" href="#resize" aria-hidden="true" tabindex="-1"></a></h3>
<p>Each image in the <em>body</em> can be resized automatically by setting a smaller width than the original one, with the extra attribute <code translate="no">{width=X}</code>.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/image.jpg){width=800}</code></pre>
<p>Is converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/thumbnails/800/image.jpg"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"800"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"600"</span>&gt;</span></code></pre>
<aside class="note note-info"><p>Ratio is preserved (<code translate="no">height</code> attribute is calculated automatically), the original file is not altered and the resized version is stored in <code translate="no">/thumbnails/&lt;width&gt;/</code>.</p></aside>
<aside class="note note-tip"><p>You can also resize all images to a maximum width with the <a href="/configuration/pages/#pages-body-images"><code translate="no">resize</code> option</a>.</p></aside>
<aside class="note note-important"><p>This feature requires an image processing library: <a href="https://www.php.net/manual/book.imagick.php" target="_blank" rel="noopener noreferrer">Imagick</a> is used first if available (and able to read JPEG and PNG), then <a href="https://www.libvips.org/" target="_blank" rel="noopener noreferrer">libvips</a> (through the PHP <a href="https://www.php.net/manual/book.ffi.php" target="_blank" rel="noopener noreferrer">FFI</a> extension), and finally <a href="https://www.php.net/manual/book.image.php" target="_blank" rel="noopener noreferrer">GD</a> as fallback; otherwise it only adds a <code translate="no">width</code> HTML attribute to the <code translate="no">img</code> tag.</p></aside>
<aside class="note note-info"><p>libvips support is optional and is not bundled with <code translate="no">cecil.phar</code>. To use it, Cecil must be installed with <a href="https://getcomposer.org" target="_blank" rel="noopener noreferrer">Composer</a>, and you need:</p>
<ol>
<li><a href="https://www.libvips.org/install.html" target="_blank" rel="noopener noreferrer">libvips</a> installed on your system</li>
<li>the PHP <a href="https://www.php.net/manual/book.ffi.php" target="_blank" rel="noopener noreferrer">FFI</a> extension enabled</li>
<li>the <code translate="no">intervention/image-driver-vips</code> package installed alongside Cecil</li>
</ol>
<p>If Cecil is a dependency of your project (see <a href="/developers/library/#libvips-support">Library</a>):</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">composer require intervention/image-driver-vips</code></pre>
<p>If Cecil is installed globally:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">composer global require cecil/cecil intervention/image-driver-vips</code></pre></aside>
<h3 id="formats">Formats<a class="heading-anchor" href="#formats" aria-hidden="true" tabindex="-1"></a></h3>
<p>If the <a href="/configuration/pages/#pages-body-images"><code translate="no">formats</code> option</a> is defined, alternative images are created and added.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/image.jpg)</code></pre>
<p>Could be converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><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">srcset</span>=<span class="hljs-string">"/image.avif"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/avif"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">source</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"/image.webp"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/webp"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/image.jpg"</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">picture</span>&gt;</span></code></pre>
<aside class="note note-important"><p>Please note that <strong>not all image formats</strong> are always included in the PHP image extensions.</p></aside>
<h3 id="responsive">Responsive<a class="heading-anchor" href="#responsive" aria-hidden="true" tabindex="-1"></a></h3>
<p>If the <a href="/configuration/pages/#pages-body-images"><code translate="no">responsive</code> option</a> is enabled, then all images in the <em>body</em> will be made responsive automatically.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/image.jpg){width=800}</code></pre>
<p>will be converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/thumbnails/800/image.jpg"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"800"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"600"</span>
  <span class="hljs-attr">srcset</span>=<span class="hljs-string">"/thumbnails/480/image.jpg 480w,
          /thumbnails/640/image.jpg 640w,
          /thumbnails/768/image.jpg 768w,
          /thumbnails/800/image.jpg 800w"</span>
  <span class="hljs-attr">sizes</span>=<span class="hljs-string">"100vw"</span>
&gt;</span></code></pre>
<aside class="note note-info"><p>Because a body image is converted into an <a href="/assets/#asset">Asset</a>, the different widths are defined (and can be changed) in the <code translate="no">assets.images.responsive.widths</code> option of the <a href="/configuration/assets/">assets configuration</a>.</p></aside>
<p>The <code translate="no">sizes</code> attribute takes the value of the <code translate="no">assets.images.responsive.sizes.default</code> configuration option, but it can be changed by creating a new entry named after a <em>class</em> added to the image.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">responsive:</span>
      <span class="hljs-attr">sizes:</span>
        <span class="hljs-attr">default:</span> <span class="hljs-string">100vw</span>
        <span class="hljs-attr">my_class:</span> <span class="hljs-string">"(max-width: 800px) 768px, 1024px"</span></code></pre>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/image.jpg){.my_class}</code></pre>
<aside class="note note-info"><p>You can combine <code translate="no">formats</code> and <code translate="no">responsive</code> options.</p></aside>
<h3 id="css-class">CSS class<a class="heading-anchor" href="#css-class" aria-hidden="true" tabindex="-1"></a></h3>
<p>You can set a default value to the <code translate="no">class</code> attribute of each image with the <a href="/configuration/pages/#pages-body-images"><code translate="no">class</code> option</a>.</p>
<h3 id="caption">Caption<a class="heading-anchor" href="#caption" aria-hidden="true" tabindex="-1"></a></h3>
<p>The optional title can be used to create a caption (<code translate="no">figcaption</code>) automatically by enabling the <a href="/configuration/pages/#pages-body-images"><code translate="no">caption</code> option</a>.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/image.jpg "Title")</code></pre>
<p>Is converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">figure</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/image.jpg"</span> <span class="hljs-attr">title</span>=<span class="hljs-string">"Title"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">figcaption</span>&gt;</span>Title<span class="hljs-tag">&lt;/<span class="hljs-name">figcaption</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">figure</span>&gt;</span></code></pre>
<aside class="note note-info"><p>Caption supports Markdown content.</p></aside>
<h3 id="localized-image">Localized image<a class="heading-anchor" href="#localized-image" aria-hidden="true" tabindex="-1"></a></h3>
<p>For translated pages, Cecil first looks for a language-suffixed file when resolving Markdown image paths.</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/images/cecil-logo.png)</code></pre>
<p>With a French page (<code translate="no">fr</code>), Cecil tries <code translate="no">/images/cecil-logo.fr.png</code> first, then falls back to <code translate="no">/images/cecil-logo.png</code>.</p>
<h3 id="dark-and-mobile-variants">Dark and mobile variants<a class="heading-anchor" href="#dark-and-mobile-variants" aria-hidden="true" tabindex="-1"></a></h3>
<p>If the <a href="/configuration/pages/#pages-body-images"><code translate="no">dark_suffix</code> option</a> is defined (e.g.: <code translate="no">.dark</code>), Cecil looks for a dark variant of each image (e.g.: <code translate="no">image.dark.jpg</code> alongside <code translate="no">image.jpg</code>) and adds it as a <code translate="no">&lt;source media="(prefers-color-scheme: dark)"&gt;</code> in a <code translate="no">&lt;picture&gt;</code> element.</p>
<p>In the same way, if the <a href="/configuration/pages/#pages-body-images"><code translate="no">mobile_suffix</code> option</a> is defined (e.g.: <code translate="no">.mobile</code>), Cecil looks for a mobile variant of each image (e.g.: <code translate="no">image.mobile.jpg</code>) and adds it as a <code translate="no">&lt;source&gt;</code> with the <code translate="no">mobile_media_query</code> media query.</p>
<h3 id="placeholder">Placeholder<a class="heading-anchor" href="#placeholder" aria-hidden="true" tabindex="-1"></a></h3>
<p>As images are typically heavier and slower resources, and they don’t block rendering, we should attempt to give users something to look at while they wait for the image to arrive.</p>
<p>The <code translate="no">placeholder</code> attribute accepts two options:</p>
<ol>
<li><code translate="no">color</code>: display a colored background (based on image dominant color)</li>
<li><code translate="no">lqip</code>: <a href="https://www.guypo.com/introducing-lqip-low-quality-image-placeholders" target="_blank" rel="noopener noreferrer">Low-Quality Image Placeholder</a></li>
</ol>
<p><em>Examples:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">![](/images/img.jpg){placeholder=color}
![](/images/img.jpg){placeholder=lqip}</code></pre>
<aside class="note note-tip"><p>You can set a value to the <code translate="no">placeholder</code> attribute for each image with the <a href="/configuration/pages/#pages-body-images"><code translate="no">placeholder</code> option</a>.</p></aside>
<aside class="note note-warning"><p>Placeholders are only applied to JPEG, PNG and GIF images, and the <code translate="no">lqip</code> option is not compatible with animated GIF.</p></aside>
<h2 id="heading-anchors">Heading anchors<a class="heading-anchor" href="#heading-anchors" aria-hidden="true" tabindex="-1"></a></h2>
<p>An anchor link is added at the end of <code translate="no">h2</code> and <code translate="no">h3</code> headings (see the <a href="/configuration/pages/#pages-body-anchors"><code translate="no">pages.body.anchors</code></a> option), to link to a heading of a page:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">h2</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"heading"</span>&gt;</span>Heading<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"heading-anchor"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#heading"</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">"true"</span> <span class="hljs-attr">tabindex</span>=<span class="hljs-string">"-1"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span></code></pre>
<p>The link is empty: the default templates display a <code translate="no">#</code> on hover.</p>
<h2 id="table-of-contents">Table of contents<a class="heading-anchor" href="#table-of-contents" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can add a table of contents with the following Markdown syntax:</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">[toc]</code></pre>
<aside class="note note-info"><p>By default, the ToC extracts H2 and H3 headings. You can change this behavior with <a href="/configuration/pages/#pages-body">body options</a>.</p></aside>
<h2 id="excerpt">Excerpt<a class="heading-anchor" href="#excerpt" aria-hidden="true" tabindex="-1"></a></h2>
<p>An excerpt can be defined in the <em>body</em> with one of the following HTML comments: <code translate="no">&lt;!-- excerpt --&gt;</code> or <code translate="no">&lt;!-- break --&gt;</code> (see the <a href="/configuration/pages/#pages-body-excerpt"><code translate="no">pages.body.excerpt</code> option</a>).</p>
<p><em>Example:</em></p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no">Introduction.
<span class="hljs-comment">&lt;!-- excerpt --&gt;</span>
Main content.</code></pre>
<p>Then use the <a href="/templates/reference/filters/#excerpt-html"><code translate="no">excerpt_html</code> filter</a> in your template.</p>
<h2 id="notes">Notes<a class="heading-anchor" href="#notes" aria-hidden="true" tabindex="-1"></a></h2>
<p>Create a <em>Note</em> block (info, tip, important, etc.).</p>
<p><em>Example:</em></p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">:::tip
<span class="hljs-strong">**Tip:**</span> This is advice.
:::</code></pre>
<p>Is converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">aside</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"note note-tip"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>Tip:<span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span> This is advice.
  <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">aside</span>&gt;</span></code></pre>
<aside class="note note-tip"><p><strong>Tip:</strong> This is advice.</p></aside>
<aside class="note note-info"><p>Any type name can be used: it is added to the <code translate="no">class</code> attribute as <code translate="no">note-&lt;type&gt;</code> (e.g.: <code translate="no">:::danger</code> gives <code translate="no">class="note note-danger"</code>).</p></aside>
<p><em>Other examples:</em></p>
<aside class="note"><p>empty</p></aside>
<aside class="note note-info"><p>info</p></aside>
<aside class="note note-tip"><p>tip</p></aside>
<aside class="note note-important"><p>important</p></aside>
<aside class="note note-warning"><p>warning</p></aside>
<aside class="note note-caution"><p>caution</p></aside>
<h3 id="nested-notes">Nested notes<a class="heading-anchor" href="#nested-notes" aria-hidden="true" tabindex="-1"></a></h3>
<p>A note is closed by a line made of at least as many <code translate="no">:</code> as its opening line: to nest notes, use a longer fence for the parent note (<code translate="no">::::</code>, then <code translate="no">:::::</code> for a third level, etc.).</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">::::info
Before.

:::tip
<span class="hljs-strong">**Tip:**</span> This is advice.
:::

After.
::::</code></pre>
<aside class="note note-info"><p>Before.</p>
<aside class="note note-tip"><p><strong>Tip:</strong> This is advice.</p></aside>
<p>After.</p></aside>
<p>A longer fence also lets you show the note syntax in a code block, inside a note.</p>
<h3 id="templates">Templates<a class="heading-anchor" href="#templates" aria-hidden="true" tabindex="-1"></a></h3>
<p>A note is rendered with the <code translate="no">partials/notes/&lt;type&gt;.html.twig</code> template, if it exists (in the site <code translate="no">layouts/</code>, in a theme or built-in), instead of the <code translate="no">&lt;aside&gt;</code> element.</p>
<p>Cecil provides templates for the following types, rendered without JavaScript: a theme can style them, override them and add interactivity. Unlike other notes, their root element is a <code translate="no">&lt;div class="note note-&lt;type&gt;"&gt;</code> (not an <code translate="no">&lt;aside&gt;</code>), as their content is part of the main content.</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Items</th>
<th>Rendering</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">tabs</code></td>
<td>one per <code translate="no">####</code> heading</td>
<td>stacked panels (<code translate="no">&lt;section class="note-tab"&gt;</code>)</td>
</tr>
<tr>
<td><code translate="no">code-group</code></td>
<td>one per <code translate="no">####</code> heading, or one per code block (titled with its language)</td>
<td>same as <code translate="no">tabs</code></td>
</tr>
<tr>
<td><code translate="no">steps</code></td>
<td>one per <code translate="no">####</code> heading</td>
<td>ordered list (<code translate="no">&lt;ol class="note-steps-list"&gt;</code>)</td>
</tr>
<tr>
<td><code translate="no">accordion</code></td>
<td>one per <code translate="no">####</code> heading</td>
<td><code translate="no">&lt;details class="note-accordion-item"&gt;</code></td>
</tr>
<tr>
<td><code translate="no">cards</code></td>
<td>one per list entry (a leading link is the card title), or per <code translate="no">####</code> heading</td>
<td>list (<code translate="no">&lt;ul class="note-cards-list"&gt;</code>)</td>
</tr>
</tbody>
</table>
<p>The examples below are themselves nested notes: a <code translate="no">tabs</code> note (with a <code translate="no">::::</code> fence) shows the Markdown source and its rendering.</p>
<h4 id="tabs">Tabs</h4>
<p>Alternative contents, one per <code translate="no">####</code> heading (e.g.: per operating system).</p>
<div class="note note-tabs" id="note-tabs-1">
  <section class="note-tab" id="note-tabs-1-1">
    <h4 id="markdown">Markdown</h4>
    <pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">:::tabs
<span class="hljs-section">#### macOS and Linux</span>

<span class="hljs-code">```bash
brew install cecilapp/tap/cecil
```</span>

<span class="hljs-section">#### Windows</span>

<span class="hljs-code">```bash
scoop install https://cecil.app/scoop/cecil.json
```</span>
:::</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-1-2">
    <h4 id="result">Result</h4>
    <div class="note note-tabs" id="note-tabs-2">
  <section class="note-tab" id="note-tabs-2-1">
    <h4 id="macos-and-linux">macOS and Linux</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">brew install cecilapp/tap/cecil</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-2-2">
    <h4 id="windows">Windows</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">scoop install https://cecil.app/scoop/cecil.json</code></pre>
  </section>
</div>
  </section>
</div>
<h4 id="code-group">Code group</h4>
<p>Like <code translate="no">tabs</code>, with code blocks only: without heading, each code block is titled with its language.</p>
<div class="note note-tabs" id="note-tabs-3">
  <section class="note-tab" id="note-tabs-3-1">
    <h4 id="markdown-1">Markdown</h4>
    <pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">:::code-group
<span class="hljs-code">```bash
curl -LO https://cecil.app/cecil.phar
```</span>

<span class="hljs-code">```powershell
Invoke-WebRequest https://cecil.app/cecil.phar -OutFile cecil.phar
```</span>
:::</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-3-2">
    <h4 id="result-1">Result</h4>
    <div class="note note-code-group" id="note-code-group-4">
  <section class="note-tab" id="note-code-group-4-1">
    <p class="note-tab-title">bash</p>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">curl -LO https://cecil.app/cecil.phar</code></pre>
  </section>
  <section class="note-tab" id="note-code-group-4-2">
    <p class="note-tab-title">powershell</p>
    <pre data-lang="powershell"><code class="language-powershell hljs powershell" translate="no"><span class="hljs-built_in">Invoke-WebRequest</span> https://cecil.app/cecil.phar <span class="hljs-literal">-OutFile</span> cecil.phar</code></pre>
  </section>
</div>
  </section>
</div>
<h4 id="steps">Steps</h4>
<p>A numbered procedure, one step per <code translate="no">####</code> heading.</p>
<div class="note note-tabs" id="note-tabs-5">
  <section class="note-tab" id="note-tabs-5-1">
    <h4 id="markdown-2">Markdown</h4>
    <pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">:::steps
<span class="hljs-section">#### Create a site</span>

<span class="hljs-code">```bash
php cecil.phar new:site
```</span>

<span class="hljs-section">#### Preview it</span>

<span class="hljs-code">```bash
php cecil.phar serve
```</span>
:::</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-5-2">
    <h4 id="result-2">Result</h4>
    <div class="note note-steps" id="note-steps-6">
  <ol class="note-steps-list">
    <li class="note-step">
      <h4 id="create-a-site">Create a site</h4>
      <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar new:site</code></pre>
    </li>
    <li class="note-step">
      <h4 id="preview-it">Preview it</h4>
      <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar serve</code></pre>
    </li>
  </ol>
</div>
  </section>
</div>
<h4 id="accordion">Accordion</h4>
<p>Collapsible items, one per <code translate="no">####</code> heading (e.g.: a FAQ).</p>
<div class="note note-tabs" id="note-tabs-7">
  <section class="note-tab" id="note-tabs-7-1">
    <h4 id="markdown-3">Markdown</h4>
    <pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">:::accordion
<span class="hljs-section">#### Is PHP required?</span>

No: the standalone binary embeds PHP.

<span class="hljs-section">#### Where is the generated site?</span>

In the <span class="hljs-code">`_site`</span> directory.
:::</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-7-2">
    <h4 id="result-3">Result</h4>
    <div class="note note-accordion" id="note-accordion-8">
  <details class="note-accordion-item" id="is-php-required">
    <summary>Is PHP required?</summary>
    <div class="note-accordion-content">
      <p>No: the standalone binary embeds PHP.</p>
    </div>
  </details>
  <details class="note-accordion-item" id="where-is-the-generated-site">
    <summary>Where is the generated site?</summary>
    <div class="note-accordion-content">
      <p>In the <code translate="no">_site</code> directory.</p>
    </div>
  </details>
</div>
  </section>
</div>
<h4 id="cards">Cards</h4>
<p>Links to other pages, one card per list entry: a leading link is the card title.</p>
<div class="note note-tabs" id="note-tabs-9">
  <section class="note-tab" id="note-tabs-9-1">
    <h4 id="markdown-4">Markdown</h4>
    <pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">:::cards
<span class="hljs-bullet">- </span>[<span class="hljs-string">Installation</span>](<span class="hljs-link">../getting-started/2-installation.md</span>): download and install Cecil.
<span class="hljs-bullet">- </span>[<span class="hljs-string">Configuration</span>](<span class="hljs-link">../configuration/index.md</span>): configure your site.
:::</code></pre>
  </section>
  <section class="note-tab" id="note-tabs-9-2">
    <h4 id="result-4">Result</h4>
    <div class="note note-cards" id="note-cards-10">
  <ul class="note-cards-list">
    <li class="note-card">
      <p class="note-card-title"><a href="/getting-started/installation/">Installation</a></p>
      <div class="note-card-content">download and install Cecil.</div>
    </li>
    <li class="note-card">
      <p class="note-card-title"><a href="/configuration/">Configuration</a></p>
      <div class="note-card-content">configure your site.</div>
    </li>
  </ul>
</div>
  </section>
</div>
<h4 id="custom-template">Custom template</h4>
<p>The template receives a <code translate="no">note</code> variable:</p>
<ul>
<li><code translate="no">note.type</code>: note type (e.g.: <code translate="no">tabs</code>)</li>
<li><code translate="no">note.id</code>: unique ID in the page (e.g.: <code translate="no">note-tabs-1</code>)</li>
<li><code translate="no">note.content</code>: HTML of the whole note</li>
<li><code translate="no">note.intro</code>: HTML of the content before the first <code translate="no">####</code> heading</li>
<li><code translate="no">note.items</code>: list of items, each with:<ul>
<li><code translate="no">title</code>: title (HTML)</li>
<li><code translate="no">heading</code>: heading element (HTML), with its <code translate="no">id</code> attribute</li>
<li><code translate="no">id</code>: heading ID, if any</li>
<li><code translate="no">link</code>: leading link element (HTML) of a list entry</li>
<li><code translate="no">url</code>: leading link URL of a list entry</li>
<li><code translate="no">language</code>: language of a code block</li>
<li><code translate="no">content</code>: content (HTML)</li>
</ul>
</li>
</ul>
<p>To override the rendering of a note type, create the template in your site (or theme), for example <code translate="no">layouts/partials/notes/tip.html.twig</code>:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"callout callout-</span></span></span><span class="hljs-template-variable">{{ note.type }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>
  </span><span class="hljs-template-variable">{{ note.content|<span class="hljs-keyword">raw</span> }}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span></code></pre>
<aside class="note note-info"><p>Notes are rendered when Markdown is converted, before pages rendering: a note template has access to the <code translate="no">note</code> variable and to translations (in the page language), but not to <code translate="no">page</code> or <code translate="no">site</code>.</p></aside>
<h2 id="syntax-highlight">Syntax highlight<a class="heading-anchor" href="#syntax-highlight" aria-hidden="true" tabindex="-1"></a></h2>
<p>Code block syntax highlighting is enabled by default with the <a href="/configuration/pages/#pages-body-highlight"><code translate="no">pages.body.highlight</code></a> option.</p>
<p>If needed, you can disable it with:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">highlight:</span> <span class="hljs-literal">false</span></code></pre>
<p><em>Example:</em></p>
<pre>
```php
echo "Hello world";
```
</pre>
<p>Is rendered to:</p>
<pre data-lang="php"><code class="language-php hljs php" translate="no"><span class="hljs-keyword">echo</span> <span class="hljs-string">"Hello world"</span>;</code></pre>
<aside class="note note-info"><p>You can customize the syntax highlighting style by creating your own theme. See the <a href="https://highlightjs.readthedocs.io/en/latest/theme-guide.html" target="_blank" rel="noopener noreferrer">Highlight.js Theme Guide</a>.</p></aside>
<aside class="note note-tip"><p>You can also use <a href="https://github.com/tempestphp/highlight" target="_blank" rel="noopener noreferrer">tempest/highlight</a> instead of highlight.js with the <a href="/configuration/pages/#pages-body-highlight"><code translate="no">pages.body.highlight.engine</code></a> option. It's faster, but supports fewer languages. It uses <code translate="no">hl-*</code> CSS classes: see the <a href="https://github.com/tempestphp/highlight/tree/main/src/Themes/Css" target="_blank" rel="noopener noreferrer">tempest/highlight themes</a>.</p></aside>
<p>The language of a code block is added to the <code translate="no">data-lang</code> attribute of the <code translate="no">&lt;pre&gt;</code> element (e.g.: <code translate="no">&lt;pre data-lang="php"&gt;</code>): the default templates display it as a label.</p>
<h2 id="inserted-text">Inserted text<a class="heading-anchor" href="#inserted-text" aria-hidden="true" tabindex="-1"></a></h2>
<p>Represents a range of text that has been added.</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">++text++</code></pre>
<p>Is converted to:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">ins</span>&gt;</span>text<span class="hljs-tag">&lt;/<span class="hljs-name">ins</span>&gt;</span></code></pre>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/getting-started/directory-structure/</id>
    <title>Directory structure</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-15T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/getting-started/directory-structure/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Directory structure</h1>
<p>This page describes how a Cecil project is organized, what the built website looks like and how files are routed to URLs.</p>
<h2 id="file-system-tree">File system tree<a class="heading-anchor" href="#file-system-tree" aria-hidden="true" tabindex="-1"></a></h2>
<p>Project files organization.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">&lt;mywebsite&gt;
├─ pages
|  ├─ blog            &lt;- Section
|  |  ├─ post-1.md    &lt;- Page in Section
|  |  └─ post-2.md
|  ├─ projects
|  |  └─ project-a.md
|  └─ about.md        &lt;- Root page
├─ assets
|  ├─ styles.scss     &lt;- Asset file
|  └─ logo.png
├─ static
|  └─ file.pdf        &lt;- Static file
├─ data
|  └─ authors.yml     &lt;- Data collection
└─ schemas
   └─ blog.yml        &lt;- Front matter schema of a Section</code></pre>
<h2 id="built-website-tree">Built website tree<a class="heading-anchor" href="#built-website-tree" aria-hidden="true" tabindex="-1"></a></h2>
<p>Result of the build.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">&lt;mywebsite&gt;
└─ _site
   ├─ index.html               &lt;- Generated home page
   ├─ blog/
   |  ├─ index.html            &lt;- Generated list of posts
   |  ├─ post-1/index.html     &lt;- A blog post
   |  └─ post-2/index.html
   ├─ projects/
   |  ├─ index.html            &lt;- Generated list of projects
   |  └─ project-a/index.html  &lt;- A project
   ├─ about/index.html         &lt;- “About” page
   ├─ styles.css               &lt;- Compiled asset
   ├─ logo.png
   └─ file.pdf</code></pre>
<aside class="note note-info"><p>By default, each page is generated as <code translate="no">slugified-filename/index.html</code> to get a “beautiful” URL like <code translate="no">https://mywebsite.tld/section/slugified-filename/</code>.</p>
<p>To get an “ugly” URL (like <code translate="no">404.html</code> instead of <code translate="no">404/</code>), set <code translate="no">uglyurl: true</code> in the page’s <a href="/content/pages/#front-matter">front matter</a>.</p>
<p>Files of the <code translate="no">assets</code> directory are published only when they are used in templates (with the <code translate="no">asset()</code> function), whereas files of the <code translate="no">static</code> directory are copied as is.</p>
<p>Files of the <code translate="no">schemas</code> directory are the <a href="/configuration/pages/#schemas-directory">front matter schemas</a>, one file by <em>Section</em> or by page.</p></aside>
<h2 id="file-based-routing">File-based routing<a class="heading-anchor" href="#file-based-routing" aria-hidden="true" tabindex="-1"></a></h2>
<p>Markdown files in the <code translate="no">pages</code> directory enable file-based routing. This means that adding <code translate="no">pages/my-projects/project-a.md</code>, for instance, makes it available at <code translate="no">/my-projects/project-a/</code> in your browser.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">File:
                   pages/my-projects/project-a.md
                        └───── filepath ──────┘
URL:
    ┌───── baseurl ─────┬─────── path ────────┐
     https://example.com/my-projects/project-a/index.html
                        └─ section ─┴─ slug ──┘</code></pre>
<aside class="note note-important"><p>Two kinds of prefixes can alter the URL. See the <a href="/content/pages/#file-prefix">File prefix section</a>.</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/reference/filters/</id>
    <title>Filters</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-15T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/reference/filters/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Filters</h1>
<p>Variables can be modified by <a href="https://twig.symfony.com/doc/filters/index.html" target="_blank" rel="noopener noreferrer">filters</a>. Filters are separated from the variable by a pipe symbol (<code translate="no">|</code>). Multiple filters can be chained. The output of one filter is applied to the next.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ page.title|truncate(25)|<span class="hljs-keyword">capitalize</span> }}</span></code></pre>
<aside class="note note-info"><p>See also: filters dedicated to assets (<code translate="no">resize</code>, <code translate="no">minify</code>, <code translate="no">fingerprint</code>, <code translate="no">to_css</code>, <code translate="no">inline</code>, <code translate="no">webp</code>, <code translate="no">lqip</code>, etc.) are documented in the <a href="/assets/">Assets</a> section.</p></aside>
<h2 id="filter-by">filter_by<a class="heading-anchor" href="#filter-by" aria-hidden="true" tabindex="-1"></a></h2>
<p>Filters a pages collection by variable name/value.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ collection|filter_by(variable, value) }}</span></code></pre>
<p>Only regular pages (type <code translate="no">page</code>, not redirections) are returned.</p>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ pages|filter_by('section', 'blog') }}</span></code></pre>
<h2 id="filter">filter<a class="heading-anchor" href="#filter" aria-hidden="true" tabindex="-1"></a></h2>
<p>For more complex cases, you should use <a href="https://twig.symfony.com/doc/filters/filter.html" target="_blank" rel="noopener noreferrer">Twig’s native <code translate="no">filter</code></a>.</p>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> filtered = pages|<span class="hljs-keyword">filter</span>(p =&gt; p.generated == false and p.id not in ['page-1', 'page-2']) %}</span></code></pre>
<h2 id="markdown-to-html">markdown_to_html<a class="heading-anchor" href="#markdown-to-html" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts a Markdown string to HTML.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ markdown|markdown_to_html }}</span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> markdown_to_html %}</span><span class="xml">
</span><span class="hljs-comment">{# Markdown 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 data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> markdown = '**This is bold text**' %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ markdown|markdown_to_html }}</span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> markdown_to_html %}</span><span class="xml">
**This is bold text**
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span></code></pre>
<h2 id="toc">toc<a class="heading-anchor" href="#toc" aria-hidden="true" tabindex="-1"></a></h2>
<p>Extracts only headings matching the given <code translate="no">selectors</code> (h2, h3, etc.), or those defined in config <code translate="no">pages.body.toc</code> if not specified.<br>
The <code translate="no">format</code> parameter defines the output format: <code translate="no">html</code> (default) or <code translate="no">json</code>.<br>
The <code translate="no">url</code> parameter is used to build links to headings.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ markdown|toc(format, selectors, url) }}</span></code></pre>
<p><em>Examples:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ page.body|toc }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ page.body|toc('html') }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ page.body|toc(selectors=['h2']) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ page.body|toc(url=url(page)) }}</span></code></pre>
<h2 id="json-decode">json_decode<a class="heading-anchor" href="#json-decode" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts a JSON string to an array.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ json|json_decode }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> json = '{"foo": "bar"}' %}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> array = json|json_decode %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ array.foo }}</span></code></pre>
<h2 id="yaml-parse">yaml_parse<a class="heading-anchor" href="#yaml-parse" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts a YAML string to an array.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ yaml|yaml_parse }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> yaml = 'key: value' %}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> array = yaml|yaml_parse %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ array.key }}</span></code></pre>
<h2 id="slugify">slugify<a class="heading-anchor" href="#slugify" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts a string to a slug.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|slugify }}</span></code></pre>
<h2 id="u">u<a class="heading-anchor" href="#u" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">u</code> filter wraps a text in a Unicode object (a <a href="https://symfony.com/doc/current/components/string.html" target="_blank" rel="noopener noreferrer">Symfony UnicodeString instance</a>) that exposes methods to "manipulate" the string.</p>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ 'cecil_string with twig'|u.camel.title }}</span></code></pre>
<blockquote>
<p>CecilStringWithTwig</p>
</blockquote>
<h2 id="singular">singular<a class="heading-anchor" href="#singular" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">singular</code> filter transforms a given noun in its plural form into its singular version.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|singular(locale) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# English (en) rules are used by default #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ 'partitions'|singular }}</span></code></pre>
<blockquote>
<p>partition</p>
</blockquote>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ 'partitions'|singular('fr') }}</span></code></pre>
<blockquote>
<p>partition</p>
</blockquote>
<h2 id="plural">plural<a class="heading-anchor" href="#plural" aria-hidden="true" tabindex="-1"></a></h2>
<p>The <code translate="no">plural</code> filter transforms a given noun in its singular form into its plural version.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|plural(locale) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# English (en) rules are used by default #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ 'animal'|plural }}</span></code></pre>
<blockquote>
<p>animals</p>
</blockquote>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ 'animal'|plural('fr') }}</span></code></pre>
<blockquote>
<p>animaux</p>
</blockquote>
<h2 id="excerpt">excerpt<a class="heading-anchor" href="#excerpt" aria-hidden="true" tabindex="-1"></a></h2>
<p>Truncates a string and appends a suffix.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|excerpt(length, suffix) }}</span></code></pre>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Type</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>length</td>
<td>Truncates after this number of characters.</td>
<td>integer</td>
<td>450</td>
</tr>
<tr>
<td>suffix</td>
<td>Appends characters.</td>
<td>string</td>
<td><code translate="no">' …'</code> (space and ellipsis)</td>
</tr>
</tbody>
</table>
<p><em>Examples:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|excerpt }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ variable|excerpt(250, '...') }}</span></code></pre>
<h2 id="excerpt-html">excerpt_html<a class="heading-anchor" href="#excerpt-html" aria-hidden="true" tabindex="-1"></a></h2>
<p>Reads characters before or after <code translate="no">&lt;!-- excerpt --&gt;</code> or <code translate="no">&lt;!-- break --&gt;</code> tag.<br>
See <a href="/content/markdown/#excerpt">Content documentation</a> for details.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|excerpt_html({separator, capture}) }}</span></code></pre>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Type</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>separator</td>
<td>String to use as separator.</td>
<td>string</td>
<td><code translate="no">excerpt|break</code></td>
</tr>
<tr>
<td>capture</td>
<td>Part to capture, <code translate="no">before</code> or <code translate="no">after</code> the separator.</td>
<td>string</td>
<td><code translate="no">before</code></td>
</tr>
</tbody>
</table>
<p>Default values are defined by the <code translate="no">pages.body.excerpt</code> configuration.</p>
<p><em>Examples:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|excerpt_html }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ variable|excerpt_html({separator: 'excerpt|break', capture: 'before'}) }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ variable|excerpt_html({capture: 'after'}) }}</span></code></pre>
<h2 id="absolute-urls">absolute_urls<a class="heading-anchor" href="#absolute-urls" aria-hidden="true" tabindex="-1"></a></h2>
<p>Makes the root-relative URLs (e.g. <code translate="no">/about/</code>, <code translate="no">/images/photo.png</code>) of the <code translate="no">href</code>, <code translate="no">src</code> and <code translate="no">srcset</code> attributes of an HTML content absolute, with the scheme and the host of the <code translate="no">baseurl</code>, to use the content outside of the site (feeds, e-mails, etc.).</p>
<p>Other URLs (absolute or protocol-relative URLs, relative paths, anchors, <code translate="no">mailto:</code>, <code translate="no">data:</code>, etc.) are kept as is, and the content is unchanged if the <code translate="no">baseurl</code> is not absolute.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|absolute_urls }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# with `baseurl: https://example.com/` #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ '&lt;a href="/about/"&gt;About&lt;/a&gt; &lt;img src="/images/photo.png" srcset="/images/photo-320.png 320w"&gt;'|absolute_urls }}</span><span class="xml">
</span><span class="hljs-comment">{# &lt;a href="https://example.com/about/"&gt;About&lt;/a&gt; &lt;img src="https://example.com/images/photo.png" srcset="https://example.com/images/photo-320.png 320w"&gt; #}</span></code></pre>
<aside class="note note-info"><p>The built-in feeds (Atom, RSS and JSON Feed) apply this filter to the content of their items.</p></aside>
<h2 id="highlight">highlight<a class="heading-anchor" href="#highlight" aria-hidden="true" tabindex="-1"></a></h2>
<p>Highlights a code string.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ code|highlight(language, engine) }}</span></code></pre>
<p>The highlighter engine (<code translate="no">highlightjs</code> or <code translate="no">tempest</code>) is the optional <code translate="no">engine</code> argument or, by default, the <a href="/configuration/layouts/#layouts-highlight"><code translate="no">layouts.highlight.engine</code></a> option (<code translate="no">highlightjs</code> by default).</p>
<aside class="note note-tip"><p>The filter does not use the <a href="/configuration/pages/#pages-body-highlight"><code translate="no">pages.body.highlight.engine</code></a> option, which only applies to Markdown content.</p></aside>
<p>If the language is not supported by the engine, the code is returned escaped, without highlighting (and a warning is logged).</p>
<p><em>Examples:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ '&lt;?php echo $highlighted-&gt;value; ?&gt;'|highlight('php') }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ '&lt;?php echo $highlighted-&gt;value; ?&gt;'|highlight('php', 'tempest') }}</span></code></pre>
<aside class="note note-info"><p>Each engine uses its own CSS classes (<code translate="no">hljs-*</code> for <code translate="no">highlightjs</code>, <code translate="no">hl-*</code> for <code translate="no">tempest</code>): the stylesheet must match the engine used.</p></aside>
<h2 id="preg-split">preg_split<a class="heading-anchor" href="#preg-split" aria-hidden="true" tabindex="-1"></a></h2>
<p>Splits a string into an array using a regular expression (<code translate="no">limit</code> is <code translate="no">0</code>, i.e. no limit, by default).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|preg_split(pattern, limit) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> headers = page.content|preg_split('/&lt;br[^&gt;]*&gt;/') %}</span></code></pre>
<h2 id="preg-match-all">preg_match_all<a class="heading-anchor" href="#preg-match-all" aria-hidden="true" tabindex="-1"></a></h2>
<p>Performs a regular expression match and returns the group for all matches (<code translate="no">group</code> is <code translate="no">0</code>, i.e. the full match, by default).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|preg_match_all(pattern, group) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> tags = page.content|preg_match_all('/&lt;[^&gt;]+&gt;(.*)&lt;\/[^&gt;]+&gt;/') %}</span></code></pre>
<h2 id="hex-to-rgb">hex_to_rgb<a class="heading-anchor" href="#hex-to-rgb" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts a hexadecimal color to RGB: returns an array with <code translate="no">red</code>, <code translate="no">green</code> and <code translate="no">blue</code> keys.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ color|hex_to_rgb }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> rgb = '#f00'|hex_to_rgb %}</span><span class="xml">
rgb(</span><span class="hljs-template-variable">{{ rgb.red }}</span><span class="xml">, </span><span class="hljs-template-variable">{{ rgb.green }}</span><span class="xml">, </span><span class="hljs-template-variable">{{ rgb.blue }}</span><span class="xml">)</span></code></pre>
<blockquote>
<p>rgb(255, 0, 0)</p>
</blockquote>
<h2 id="splitline">splitline<a class="heading-anchor" href="#splitline" aria-hidden="true" tabindex="-1"></a></h2>
<p>Splits a string into an array of lines of <code translate="no">max</code> characters maximum (<code translate="no">18</code> by default), without breaking words.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ string|splitline(<span class="hljs-name">max</span>) }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> line in 'The quick brown fox jumps'|splitline(10) %}</span><span class="xml">
  </span><span class="hljs-template-variable">{{ line }}</span><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">br</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span></code></pre>
<blockquote>
<p>The quick<br>brown fox<br>jumps</p>
</blockquote>
<h2 id="iterable">iterable<a class="heading-anchor" href="#iterable" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts a variable to an iterable (array): an array is returned as is, a traversable object is converted to an array, and any other value is wrapped in an array.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|iterable }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> author in page.authors|iterable %}</span><span class="xml">
  </span><span class="hljs-template-variable">{{ author }}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span></code></pre>
<h2 id="unique">unique<a class="heading-anchor" href="#unique" aria-hidden="true" tabindex="-1"></a></h2>
<p>Removes duplicate values from an array of strings (case-insensitive: the first occurrence is kept).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ array|unique }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ ['PHP', 'php', 'Twig']|unique|<span class="hljs-keyword">join</span>(', ') }}</span></code></pre>
<blockquote>
<p>PHP, Twig</p>
</blockquote>
<h2 id="duration-to-iso8601">duration_to_iso8601<a class="heading-anchor" href="#duration-to-iso8601" aria-hidden="true" tabindex="-1"></a></h2>
<p>Converts a duration in seconds to an <a href="https://en.wikipedia.org/wiki/ISO_8601#Durations" target="_blank" rel="noopener noreferrer">ISO 8601 duration</a> (e.g.: for the <code translate="no">duration</code> of a video in structured data).</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ seconds|duration_to_iso8601 }}</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ 125|duration_to_iso8601 }}</span></code></pre>
<blockquote>
<p>PT00H00M125S</p>
</blockquote>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/pages/</id>
    <title>Pages</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-15T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/pages/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Pages</h1>
<p>These options control how pages are loaded, sorted, paginated, routed and generated.</p>
<h2 id="pages-dir">pages.dir<a class="heading-anchor" href="#pages-dir" aria-hidden="true" tabindex="-1"></a></h2>
<p>Source directory of pages (<code translate="no">pages</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">pages</span></code></pre>
<h2 id="pages-ext">pages.ext<a class="heading-anchor" href="#pages-ext" aria-hidden="true" tabindex="-1"></a></h2>
<p>Extensions of pages files.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">ext:</span> <span class="hljs-string">[md,</span> <span class="hljs-string">markdown,</span> <span class="hljs-string">mdown,</span> <span class="hljs-string">mkdn,</span> <span class="hljs-string">mkd,</span> <span class="hljs-string">text,</span> <span class="hljs-string">txt]</span></code></pre>
<h2 id="pages-exclude">pages.exclude<a class="heading-anchor" href="#pages-exclude" aria-hidden="true" tabindex="-1"></a></h2>
<p>Directories, paths and files name to exclude (accepts globs, strings and regexes).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">exclude:</span> <span class="hljs-string">['vendor',</span> <span class="hljs-string">'node_modules'</span><span class="hljs-string">,</span> <span class="hljs-string">'*.scss'</span><span class="hljs-string">,</span> <span class="hljs-string">'/\.bck$/'</span><span class="hljs-string">]</span></code></pre>
<h2 id="pages-prefix-separator">pages.prefix.separator<a class="heading-anchor" href="#pages-prefix-separator" aria-hidden="true" tabindex="-1"></a></h2>
<p>List of characters used as separator between a filename prefix (<code translate="no">date</code> or <code translate="no">weight</code>) and the slug.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">prefix:</span>
    <span class="hljs-attr">separator:</span> <span class="hljs-string">['-',</span> <span class="hljs-string">'_'</span><span class="hljs-string">]</span></code></pre>
<h2 id="pages-sortby">pages.sortby<a class="heading-anchor" href="#pages-sortby" aria-hidden="true" tabindex="-1"></a></h2>
<p>Default collections sort method.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">sortby:</span> <span class="hljs-string">date</span> <span class="hljs-comment"># `date`, `updated`, `title` or `weight`</span>
  <span class="hljs-comment"># or</span>
  <span class="hljs-attr">sortby:</span>
    <span class="hljs-attr">variable:</span> <span class="hljs-string">date</span>    <span class="hljs-comment"># `date`, `updated`, `title` or `weight`</span>
    <span class="hljs-attr">desc_title:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># sort by title in descending order</span>
    <span class="hljs-attr">reverse:</span> <span class="hljs-literal">false</span>    <span class="hljs-comment"># reverse the sort order</span></code></pre>
<h2 id="pages-pagination">pages.pagination<a class="heading-anchor" href="#pages-pagination" aria-hidden="true" tabindex="-1"></a></h2>
<p>Pagination is available for list pages (<em>type</em> is <code translate="no">homepage</code>, <code translate="no">section</code> or <code translate="no">term</code>).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">pagination:</span>
    <span class="hljs-attr">max:</span> <span class="hljs-number">5</span>     <span class="hljs-comment"># maximum number of entries per page</span>
    <span class="hljs-attr">path:</span> <span class="hljs-string">page</span> <span class="hljs-comment"># path to the paginated page</span></code></pre>
<h3 id="disable-pagination">Disable pagination<a class="heading-anchor" href="#disable-pagination" aria-hidden="true" tabindex="-1"></a></h3>
<p>Pagination can be disabled:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">pagination:</span> <span class="hljs-literal">false</span></code></pre>
<p>Or:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">pagination:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">false</span></code></pre>
<aside class="note note-tip"><p>When pagination is disabled globally, a list page can still enable it in its <a href="/content/pages/#pagination">front matter</a> with <code translate="no">pagination.enabled: true</code>.</p></aside>
<h2 id="pages-paths">pages.paths<a class="heading-anchor" href="#pages-paths" aria-hidden="true" tabindex="-1"></a></h2>
<p>Apply a custom <a href="/content/front-matter/#predefined-variables"><code translate="no">path</code></a> for all pages of a <strong><em>Section</em></strong>.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">paths:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">section:</span> <span class="hljs-string">&lt;section’s</span> <span class="hljs-string">ID&gt;</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">&lt;path</span> <span class="hljs-string">of</span> <span class="hljs-string">pages&gt;</span></code></pre>
<h3 id="path-placeholders">Path placeholders<a class="heading-anchor" href="#path-placeholders" aria-hidden="true" tabindex="-1"></a></h3>
<ul>
<li><code translate="no">:year</code></li>
<li><code translate="no">:month</code></li>
<li><code translate="no">:day</code></li>
<li><code translate="no">:section</code></li>
<li><code translate="no">:slug</code></li>
</ul>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">paths:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">section:</span> <span class="hljs-string">Blog</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">:section/:year/:month/:day/:slug</span> <span class="hljs-comment"># e.g.: /blog/2020/12/01/my-post/</span>
<span class="hljs-comment"># localized</span>
<span class="hljs-attr">languages:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">code:</span> <span class="hljs-string">fr</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">Français</span>
    <span class="hljs-attr">locale:</span> <span class="hljs-string">fr_FR</span>
    <span class="hljs-attr">config:</span>
      <span class="hljs-attr">pages:</span>
        <span class="hljs-attr">paths:</span>
          <span class="hljs-bullet">-</span> <span class="hljs-attr">section:</span> <span class="hljs-string">Blog</span>
            <span class="hljs-attr">path:</span> <span class="hljs-string">blogue/:year/:month/:day/:slug</span> <span class="hljs-comment"># e.g.: /blogue/2020/12/01/mon-billet/</span></code></pre>
<h2 id="pages-frontmatter">pages.frontmatter<a class="heading-anchor" href="#pages-frontmatter" aria-hidden="true" tabindex="-1"></a></h2>
<p>Page front matter format (<code translate="no">yaml</code> by default, also accepts <code translate="no">ini</code>, <code translate="no">toml</code> and <code translate="no">json</code>).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">frontmatter:</span> <span class="hljs-string">yaml</span></code></pre>
<h2 id="pages-validation">pages.validation<a class="heading-anchor" href="#pages-validation" aria-hidden="true" tabindex="-1"></a></h2>
<p>Behavior when the front matter of a page does not match its <a href="#pages-schema">schema</a>:</p>
<ul>
<li><code translate="no">warning</code>: logs a warning and keeps the page;</li>
<li><code translate="no">error</code> (default): logs an error and skips the page;</li>
<li><code translate="no">strict</code>: the build fails;</li>
<li><code translate="no">false</code>: disables the validation.</li>
</ul>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">validation:</span> <span class="hljs-string">error</span></code></pre>
<aside class="note note-info"><p>The <a href="/content/front-matter/#predefined-variables">predefined variables</a> (<code translate="no">date</code>, <code translate="no">menu</code>, <code translate="no">schedule</code>, <code translate="no">output</code>, etc.) are always checked against a built-in schema, even without <code translate="no">pages.schema</code>.</p></aside>
<h2 id="pages-schema">pages.schema<a class="heading-anchor" href="#pages-schema" aria-hidden="true" tabindex="-1"></a></h2>
<p>Schemas of the front matter, by <em>Section</em> or by <a href="#schema-of-a-page">page</a> (<code translate="no">*</code> applies to all pages).</p>
<p>Schemas can also be written in the <a href="#schemas-directory"><code translate="no">schemas</code> directory</a>, one file by <em>Section</em> or by page.</p>
<p>Each variable is defined by its type, or by a map of rules:</p>
<table>
<thead>
<tr>
<th>Rule</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">type</code></td>
<td><code translate="no">string</code>, <code translate="no">int</code>, <code translate="no">number</code>, <code translate="no">bool</code>, <code translate="no">date</code>, <code translate="no">list</code>, <code translate="no">map</code>, <code translate="no">scalar</code> or <code translate="no">mixed</code> (default).</td>
</tr>
<tr>
<td><code translate="no">required</code></td>
<td>The variable must be defined (<code translate="no">false</code> by default).</td>
</tr>
<tr>
<td><code translate="no">enum</code></td>
<td>List of allowed values.</td>
</tr>
<tr>
<td><code translate="no">pattern</code></td>
<td>Regular expression that the value must match (<code translate="no">string</code> and <code translate="no">scalar</code>).</td>
</tr>
<tr>
<td><code translate="no">min</code></td>
<td>Minimum value (<code translate="no">int</code>, <code translate="no">number</code>), length (<code translate="no">string</code>) or count of items (<code translate="no">list</code>, <code translate="no">map</code>).</td>
</tr>
<tr>
<td><code translate="no">max</code></td>
<td>Maximum value (<code translate="no">int</code>, <code translate="no">number</code>), length (<code translate="no">string</code>) or count of items (<code translate="no">list</code>, <code translate="no">map</code>).</td>
</tr>
<tr>
<td><code translate="no">items</code></td>
<td>Type or definition of the items of a <code translate="no">list</code> (see <a href="#lists-and-maps">lists and maps</a>).</td>
</tr>
<tr>
<td><code translate="no">fields</code></td>
<td>Definitions of the variables of a <code translate="no">map</code> (see <a href="#lists-and-maps">lists and maps</a>).</td>
</tr>
<tr>
<td><code translate="no">default</code></td>
<td>Value applied when the variable is not defined.</td>
</tr>
<tr>
<td><code translate="no">format</code></td>
<td>What a <code translate="no">string</code> holds: <code translate="no">text</code>, <code translate="no">markdown</code>, <code translate="no">url</code>, <code translate="no">email</code> or <code translate="no">path</code> (see <a href="#description-of-the-variables">description of the variables</a>).</td>
</tr>
<tr>
<td><code translate="no">label</code></td>
<td>Name of the variable, for the tools that edit the front matter.</td>
</tr>
<tr>
<td><code translate="no">description</code></td>
<td>Help text of the variable, for the tools that edit the front matter.</td>
</tr>
</tbody>
</table>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">schema:</span>
    <span class="hljs-string">'*'</span><span class="hljs-string">:</span>
      <span class="hljs-attr">title:</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">string</span>
        <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">blog:</span>
      <span class="hljs-attr">author:</span> <span class="hljs-string">string</span> <span class="hljs-comment"># type shorthand</span>
      <span class="hljs-attr">rating:</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">int</span>
        <span class="hljs-attr">min:</span> <span class="hljs-number">1</span>
        <span class="hljs-attr">max:</span> <span class="hljs-number">5</span>
      <span class="hljs-attr">category:</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">string</span>
        <span class="hljs-attr">enum:</span> <span class="hljs-string">[news,</span> <span class="hljs-string">tutorial]</span>
        <span class="hljs-attr">default:</span> <span class="hljs-string">news</span>
      <span class="hljs-attr">tags:</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">list</span>
        <span class="hljs-attr">items:</span> <span class="hljs-string">string</span>
        <span class="hljs-attr">max:</span> <span class="hljs-number">5</span></code></pre>
<p>The length of a string (<code translate="no">min</code> and <code translate="no">max</code> rules) is counted in characters, not in bytes.</p>
<aside class="note note-info"><p>Schemas are open: variables that are not declared are allowed. Variables of a section override variables of <code translate="no">*</code>, and variables of a page override both. An optional variable can be empty (<code translate="no">null</code>).</p></aside>
<h3 id="lists-and-maps">Lists and maps<a class="heading-anchor" href="#lists-and-maps" aria-hidden="true" tabindex="-1"></a></h3>
<p>The structure of a <code translate="no">map</code> and of the items of a <code translate="no">list</code> can be validated, at any depth:</p>
<ul>
<li><code translate="no">fields</code>: definitions of the variables of a <code translate="no">map</code>, with the same syntax as the variables of a page (type shorthand or map of rules, including <code translate="no">fields</code> and <code translate="no">items</code>). As a page, a map is open: undeclared variables are allowed.</li>
<li><code translate="no">items</code>: the type of the items (<code translate="no">items: string</code>), or the definition of the items (<code translate="no">items: {type: map, fields: …}</code>).</li>
</ul>
<p>Scope of the rules:</p>
<ul>
<li>With a type of items (<code translate="no">items: string</code>), the <code translate="no">enum</code> and <code translate="no">pattern</code> rules of the list apply to its items.</li>
<li>With a definition of items, only the rules of this definition apply to the items (<code translate="no">min</code> and <code translate="no">max</code> of the definition apply to each item: length of a string, value of a number, etc.). An item can't be empty (<code translate="no">null</code>), except with <code translate="no">items: mixed</code>, and the <code translate="no">required</code> and <code translate="no">default</code> rules don't apply to items.</li>
<li>The <code translate="no">min</code> and <code translate="no">max</code> rules of a list apply to its count of items.</li>
<li>A <code translate="no">map</code> with <code translate="no">fields</code> doesn't accept the <code translate="no">min</code>, <code translate="no">max</code>, <code translate="no">enum</code> and <code translate="no">pattern</code> rules (without <code translate="no">fields</code>, <code translate="no">min</code> and <code translate="no">max</code> apply to its count of variables).</li>
<li>A <code translate="no">default</code> value of a variable of a map is applied when the map is defined but the variable is not (a missing map is not created), including in each item of a list.</li>
</ul>
<p>Example: each image of an illustration must have a file name and an alternative text of 20 characters at least.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">schema:</span>
    <span class="hljs-attr">illustrations:</span>
      <span class="hljs-attr">description:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span><span class="hljs-string">}</span>
      <span class="hljs-attr">images:</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">list</span>
        <span class="hljs-attr">min:</span> <span class="hljs-number">1</span>
        <span class="hljs-attr">items:</span>
          <span class="hljs-attr">type:</span> <span class="hljs-string">map</span>
          <span class="hljs-attr">fields:</span>
            <span class="hljs-attr">file:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span><span class="hljs-string">,</span> <span class="hljs-attr">pattern:</span> <span class="hljs-string">'^[\w-]+\.(png|jpe?g|gif|webp)$'</span><span class="hljs-string">}</span>
            <span class="hljs-attr">alt:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span><span class="hljs-string">,</span> <span class="hljs-attr">min:</span> <span class="hljs-number">20</span><span class="hljs-string">}</span></code></pre>
<p>An error gives the path of the invalid variable, from <code translate="no">0</code> for the first item of a list: <code translate="no">The mandatory variable 'images › 1 › alt' is missing.</code> (alternative text of the second image).</p>
<h3 id="schema-of-a-page">Schema of a page<a class="heading-anchor" href="#schema-of-a-page" aria-hidden="true" tabindex="-1"></a></h3>
<p>A key of <code translate="no">pages.schema</code> can also be a page, for the pages that have their own variables (a home page, a résumé, etc.). The key is the ID of the page, without its language: the path of its file in the pages directory, without prefix, language and extension.</p>
<table>
<thead>
<tr>
<th>File</th>
<th>Key</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">index.md</code></td>
<td><code translate="no">index</code></td>
</tr>
<tr>
<td><code translate="no">cv.md</code>, <code translate="no">cv.en.md</code></td>
<td><code translate="no">cv</code></td>
</tr>
<tr>
<td><code translate="no">1-My project.md</code></td>
<td><code translate="no">my-project</code></td>
</tr>
<tr>
<td><code translate="no">blog/2024-05-01_post.md</code></td>
<td><code translate="no">blog/post</code></td>
</tr>
<tr>
<td><code translate="no">blog/index.md</code></td>
<td><code translate="no">blog/index</code></td>
</tr>
</tbody>
</table>
<p>The variables are those of <code translate="no">*</code>, then of the section of the page, then of the page: the last ones override the others.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">schema:</span>
    <span class="hljs-attr">blog:</span>        <span class="hljs-comment"># pages of the "blog" section</span>
      <span class="hljs-attr">author:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span><span class="hljs-string">}</span>
    <span class="hljs-attr">blog/index:</span>  <span class="hljs-comment"># index of the "blog" section</span>
      <span class="hljs-attr">intro:</span> <span class="hljs-string">string</span>
    <span class="hljs-attr">cv:</span>          <span class="hljs-comment"># "cv.md" page, and its translations</span>
      <span class="hljs-attr">skills:</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">list</span>
        <span class="hljs-attr">items:</span>
          <span class="hljs-attr">type:</span> <span class="hljs-string">map</span>
          <span class="hljs-attr">fields:</span>
            <span class="hljs-attr">name:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span><span class="hljs-string">}</span>
            <span class="hljs-attr">level:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">int,</span> <span class="hljs-attr">min:</span> <span class="hljs-number">0</span><span class="hljs-string">,</span> <span class="hljs-attr">max:</span> <span class="hljs-number">100</span><span class="hljs-string">}</span></code></pre>
<aside class="note note-info"><p>The schema of a section applies to its pages, not to its index (<code translate="no">blog/index.md</code>), which has its own key (<code translate="no">blog/index</code>).</p></aside>
<h3 id="description-of-the-variables">Description of the variables<a class="heading-anchor" href="#description-of-the-variables" aria-hidden="true" tabindex="-1"></a></h3>
<p>The <code translate="no">format</code>, <code translate="no">label</code> and <code translate="no">description</code> rules describe a variable to the tools that edit the front matter (e.g. <a href="https://desktop.cecil.app" target="_blank" rel="noopener noreferrer">Cecil Desktop</a> builds its form from the schema). They are accepted on any variable, also in <code translate="no">fields</code> and <code translate="no">items</code>.</p>
<p><code translate="no">format</code> tells what a <code translate="no">string</code> holds:</p>
<table>
<thead>
<tr>
<th>Format</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">text</code></td>
<td>Text of several lines.</td>
</tr>
<tr>
<td><code translate="no">markdown</code></td>
<td>Text of several lines, rendered as Markdown by the template.</td>
</tr>
<tr>
<td><code translate="no">url</code></td>
<td>Absolute URL (<code translate="no">https://cecil.app</code>): validated.</td>
</tr>
<tr>
<td><code translate="no">email</code></td>
<td>Email address: validated.</td>
</tr>
<tr>
<td><code translate="no">path</code></td>
<td>Path of a file of the site (asset or static file): not checked.</td>
</tr>
</tbody>
</table>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">schema:</span>
    <span class="hljs-attr">cv:</span>
      <span class="hljs-attr">intro:</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">string</span>
        <span class="hljs-attr">format:</span> <span class="hljs-string">markdown</span>
        <span class="hljs-attr">label:</span> <span class="hljs-string">Introduction</span>
        <span class="hljs-attr">description:</span> <span class="hljs-string">Shown</span> <span class="hljs-string">under</span> <span class="hljs-string">the</span> <span class="hljs-string">title</span> <span class="hljs-string">of</span> <span class="hljs-string">the</span> <span class="hljs-string">page.</span>
      <span class="hljs-attr">website:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">format:</span> <span class="hljs-string">url}</span>
      <span class="hljs-attr">photo:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">format:</span> <span class="hljs-string">path,</span> <span class="hljs-attr">label:</span> <span class="hljs-string">Photo}</span></code></pre>
<p><code translate="no">label</code> and <code translate="no">description</code> have no effect on the validation, and neither have the <code translate="no">text</code>, <code translate="no">markdown</code> and <code translate="no">path</code> formats.</p>
<h3 id="schemas-directory">Schemas directory<a class="heading-anchor" href="#schemas-directory" aria-hidden="true" tabindex="-1"></a></h3>
<p>Instead of writing them in the configuration, schemas can be written in the <code translate="no">schemas</code> directory, at the root of the site: one YAML file (<code translate="no">.yml</code> or <code translate="no">.yaml</code>) by key of <code translate="no">pages.schema</code>, loaded automatically.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">&lt;mywebsite&gt;
├─ pages
└─ schemas
   ├─ _all.yml        &lt;- '*': all pages
   ├─ blog.yml        &lt;- "blog" section
   ├─ cv.yml          &lt;- "cv.md" page
   ├─ index.yml       &lt;- home page
   └─ blog
      └─ index.yml    &lt;- "blog/index.md" page (key "blog/index")</code></pre>
<ul>
<li>The path of a file in the directory, without its extension, is the key of the schema: a <em>Section</em>, or a <a href="#schema-of-a-page">page</a> (<code translate="no">schemas/blog/post-1.yml</code> is the schema of the <code translate="no">blog/post-1</code> page).</li>
<li>The schema of all pages (<code translate="no">*</code>) is the <code translate="no">_all.yml</code> file.</li>
<li>A key can't have two files (<code translate="no">blog.yml</code> and <code translate="no">blog.yaml</code>): this is an error.</li>
<li>A file holds the variables directly, as under <code translate="no">pages.schema.&lt;key&gt;</code>, and an empty file is an empty schema.</li>
</ul>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-comment"># schemas/cv.yml</span>
<span class="hljs-attr">sections:</span>
  <span class="hljs-attr">label:</span> <span class="hljs-string">Sections</span>
  <span class="hljs-attr">type:</span> <span class="hljs-string">list</span>
  <span class="hljs-attr">items:</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">map</span>
    <span class="hljs-attr">fields:</span>
      <span class="hljs-attr">title:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span><span class="hljs-string">}</span>
      <span class="hljs-attr">text:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">format:</span> <span class="hljs-string">markdown}</span></code></pre>
<p>is the same as:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">schema:</span>
    <span class="hljs-attr">cv:</span>
      <span class="hljs-attr">sections:</span>
        <span class="hljs-comment"># …</span></code></pre>
<p>Each file is validated when the configuration is loaded: an error gives the name of the file and the path of the invalid variable in it (e.g. <code translate="no">Invalid schema file "schemas/cv.yml"</code>). As in <code translate="no">pages.schema</code>, a file whose key matches no <em>Section</em> and no page is ignored.</p>
<p>A <a href="/templates/extend/#theme">theme</a> can also have a <code translate="no">schemas</code> directory, for the variables its templates expect. Schemas are merged from the lowest to the highest priority:</p>
<ol>
<li><code translate="no">schemas</code> directories of the themes (a theme overrides the themes after it in the list);</li>
<li><code translate="no">pages.schema</code> of the <code translate="no">config.yml</code> of the themes (a theme overrides the themes after it in the list);</li>
<li><code translate="no">schemas</code> directory of the site;</li>
<li><code translate="no">pages.schema</code> of the configuration of the site.</li>
</ol>
<p>For a same key, variables are merged one by one, at each level and between themes: the definition of a variable replaces its previous definition as a whole (its rules are not merged, and <code translate="no">enum</code> lists are not combined), the other variables are kept.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-comment"># schemas/blog.yml</span>
<span class="hljs-attr">author:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">string,</span> <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span><span class="hljs-string">}</span>
<span class="hljs-attr">tags:</span> <span class="hljs-string">{type:</span> <span class="hljs-string">list,</span> <span class="hljs-attr">items:</span> <span class="hljs-string">string}</span></code></pre>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-comment"># cecil.yml</span>
<span class="hljs-attr">pages:</span>
  <span class="hljs-attr">schema:</span>
    <span class="hljs-attr">blog:</span>
      <span class="hljs-attr">author:</span> <span class="hljs-string">string</span> <span class="hljs-comment"># "author" is now optional, "tags" is kept</span></code></pre>
<aside class="note note-info"><p>With <code translate="no">cecil serve</code>, a change in a <code translate="no">schemas</code> directory rebuilds the whole site with the schemas loaded again.</p></aside>
<h2 id="pages-converter">pages.converter<a class="heading-anchor" href="#pages-converter" aria-hidden="true" tabindex="-1"></a></h2>
<p>Class used to convert the front matter and the Markdown body of pages (<code translate="no">Cecil\Converter\Converter</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">converter:</span> <span class="hljs-string">Cecil\Converter\Converter</span></code></pre>
<p>See <a href="/developers/extend/#markdown-converter">Markdown converter</a> to use your own.</p>
<h2 id="pages-body">pages.body<a class="heading-anchor" href="#pages-body" aria-hidden="true" tabindex="-1"></a></h2>
<p>Page body options.</p>
<aside class="note note-info"><p>To know how these options impact your content see <em><a href="/content/markdown/">Content &gt; Markdown</a></em> documentation.</p></aside>
<h3 id="pages-body-parser">pages.body.parser<a class="heading-anchor" href="#pages-body-parser" aria-hidden="true" tabindex="-1"></a></h3>
<p>Markdown parser class (<code translate="no">Cecil\Converter\Parsedown</code> by default). It must extend <code translate="no">Cecil\Converter\Parsedown</code>: see <a href="/developers/extend/#markdown-parser">Markdown parser</a> to add your own syntax.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">parser:</span> <span class="hljs-string">Cecil\Converter\Parsedown</span></code></pre>
<h3 id="pages-body-toc">pages.body.toc<a class="heading-anchor" href="#pages-body-toc" aria-hidden="true" tabindex="-1"></a></h3>
<p>Headers used to build the table of contents (<code translate="no">[h2, h3]</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">toc:</span> <span class="hljs-string">[h2,</span> <span class="hljs-string">h3]</span></code></pre>
<h3 id="pages-body-anchors">pages.body.anchors<a class="heading-anchor" href="#pages-body-anchors" aria-hidden="true" tabindex="-1"></a></h3>
<p>Headings with an anchor link (<code translate="no">[h2, h3]</code> by default): an empty <code translate="no">&lt;a class="heading-anchor" href="#&lt;id&gt;"&gt;</code> element is added at the end of each of these headings that have an ID, to be styled by templates (e.g.: a <code translate="no">#</code> displayed on hover).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">anchors:</span> <span class="hljs-string">[h2,</span> <span class="hljs-string">h3]</span> <span class="hljs-comment"># set to false to disable anchors</span></code></pre>
<h3 id="pages-body-highlight">pages.body.highlight<a class="heading-anchor" href="#pages-body-highlight" aria-hidden="true" tabindex="-1"></a></h3>
<p>Enables code syntax highlighting (<code translate="no">true</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">highlight:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># set to false to disable syntax highlighting</span></code></pre>
<p>The highlighter engine can be changed with the <code translate="no">engine</code> option:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">highlight:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># `true` by default</span>
      <span class="hljs-attr">engine:</span> <span class="hljs-string">tempest</span>  <span class="hljs-comment"># `highlightjs` (default) or `tempest`</span></code></pre>
<ul>
<li><code translate="no">highlightjs</code>: <a href="https://github.com/scrivo/highlight.php" target="_blank" rel="noopener noreferrer">highlight.php</a>, a PHP port of highlight.js (190+ languages, <code translate="no">hljs-*</code> CSS classes)</li>
<li><code translate="no">tempest</code>: <a href="https://github.com/tempestphp/highlight" target="_blank" rel="noopener noreferrer">tempest/highlight</a>, a fast server-side highlighter (web languages: PHP, HTML, CSS, JavaScript, JSON, YAML, Twig, SQL, XML, etc., <code translate="no">hl-*</code> CSS classes)</li>
</ul>
<aside class="note note-info"><p>These options only apply to Markdown content: the <a href="/templates/reference/filters/#highlight"><code translate="no">highlight</code></a> filter of templates uses the <a href="/documentation/layouts/#layouts-highlight"><code translate="no">layouts.highlight.engine</code></a> option.</p></aside>
<h3 id="pages-body-images">pages.body.images<a class="heading-anchor" href="#pages-body-images" aria-hidden="true" tabindex="-1"></a></h3>
<p>Images handling options.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">images:</span>
      <span class="hljs-attr">formats:</span> <span class="hljs-string">[]</span>       <span class="hljs-comment"># adds alternative image formats as `source` (e.g. `[avif, webp]`, empty array by default)</span>
      <span class="hljs-attr">resize:</span> <span class="hljs-number">0</span>         <span class="hljs-comment"># resizes all images to &lt;width&gt; (in pixels, `0` to disable)</span>
      <span class="hljs-attr">responsive:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># adds responsive image variants to the `srcset` attribute (`false` by default)</span>
      <span class="hljs-attr">lazy:</span> <span class="hljs-literal">true</span>        <span class="hljs-comment"># adds `loading="lazy"` attribute (`true` by default)</span>
      <span class="hljs-attr">decoding:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># adds `decoding="async"` attribute (`true` by default)</span>
      <span class="hljs-attr">caption:</span> <span class="hljs-literal">false</span>    <span class="hljs-comment"># puts the image in a &lt;figure&gt; element and adds a &lt;figcaption&gt; containing the title (`false` by default)</span>
      <span class="hljs-attr">placeholder:</span> <span class="hljs-string">''</span>   <span class="hljs-comment"># fills the &lt;img&gt; background before loading ('color' or 'lqip', empty by default)</span>
      <span class="hljs-attr">class:</span> <span class="hljs-string">''</span>         <span class="hljs-comment"># sets a default class on each image (empty by default)</span>
      <span class="hljs-attr">dark_suffix:</span> <span class="hljs-string">~</span>    <span class="hljs-comment"># suffix of the dark variant image (e.g. `.dark`), disabled by default</span>
      <span class="hljs-attr">mobile_suffix:</span> <span class="hljs-string">~</span>  <span class="hljs-comment"># suffix of the mobile variant image (e.g. `.mobile`), disabled by default</span>
      <span class="hljs-attr">mobile_media_query:</span> <span class="hljs-string">'(max-width: 767px)'</span> <span class="hljs-comment"># media query of the mobile variant `&lt;source&gt;`</span>
      <span class="hljs-attr">remote:</span>           <span class="hljs-comment"># remote image handling (set to `false` to disable)</span>
        <span class="hljs-attr">fallback:</span>         <span class="hljs-comment"># path to the fallback image, stored in assets dir (empty by default)</span></code></pre>
<aside class="note note-warning"><p>Since version <ins>8.41.0</ins>, the <code translate="no">pages.body.images.resize</code> option is used to resize images to a specific width, no more to enable the resize feature (enabled systematically).</p></aside>
<aside class="note note-important"><p>Global options, like responsive images widths and sizes, are configurable in the <a href="/documentation/assets/#assets-images"><code translate="no">assets.images</code></a> section.</p></aside>
<aside class="note note-info"><p>Remote images are downloaded and converted into <em>Assets</em> to be manipulated. You can disable this behavior by setting the option <code translate="no">pages.body.images.remote.enabled</code> to <code translate="no">false</code>.</p></aside>
<aside class="note note-tip"><p>When <code translate="no">dark_suffix</code> is set (e.g. <code translate="no">dark_suffix: .dark</code>), Cecil automatically looks for a dark variant of each image (e.g. <code translate="no">photo.dark.jpg</code> alongside <code translate="no">photo.jpg</code>). If found, the image is wrapped in a <code translate="no">&lt;picture&gt;</code> element with a <code translate="no">&lt;source media="(prefers-color-scheme: dark)"&gt;</code> for automatic light/dark theme switching. Works in combination with <code translate="no">formats</code> and <code translate="no">responsive</code>.</p>
<p>In the same way, when <code translate="no">mobile_suffix</code> is set (e.g. <code translate="no">mobile_suffix: .mobile</code>), Cecil looks for a mobile variant of each image (e.g. <code translate="no">photo.mobile.jpg</code> alongside <code translate="no">photo.jpg</code>) and adds a <code translate="no">&lt;source&gt;</code> element with the <code translate="no">mobile_media_query</code> media query (<code translate="no">(max-width: 767px)</code> by default). If <code translate="no">dark_suffix</code> is also set, the dark variant of the mobile image (e.g. <code translate="no">photo.mobile.dark.jpg</code>) is used on mobile with dark color scheme. Mobile sources are placed before dark sources, so that a mobile variant takes precedence.</p></aside>
<h3 id="pages-body-links">pages.body.links<a class="heading-anchor" href="#pages-body-links" aria-hidden="true" tabindex="-1"></a></h3>
<p>Links handling options.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">links:</span>
      <span class="hljs-attr">embed:</span>
        <span class="hljs-attr">enabled:</span> <span class="hljs-literal">false</span>     <span class="hljs-comment"># turns links into embedded content if possible (`false` by default)</span>
        <span class="hljs-attr">video:</span> <span class="hljs-string">[mp4,</span> <span class="hljs-string">webm]</span> <span class="hljs-comment"># video files extensions</span>
        <span class="hljs-attr">audio:</span> <span class="hljs-string">[mp3,</span> <span class="hljs-string">ogg,</span> <span class="hljs-string">wav]</span> <span class="hljs-comment"># audio files extensions</span>
      <span class="hljs-attr">external:</span>
        <span class="hljs-attr">blank:</span> <span class="hljs-literal">false</span>     <span class="hljs-comment"># if true open external link in new tab</span>
        <span class="hljs-attr">noopener:</span> <span class="hljs-literal">true</span>   <span class="hljs-comment"># if true add "noopener" to `rel` attribute</span>
        <span class="hljs-attr">noreferrer:</span> <span class="hljs-literal">true</span> <span class="hljs-comment"># if true add "noreferrer" to `rel` attribute</span>
        <span class="hljs-attr">nofollow:</span> <span class="hljs-literal">false</span>  <span class="hljs-comment"># if true add "nofollow" to `rel` attribute</span></code></pre>
<h3 id="pages-body-excerpt">pages.body.excerpt<a class="heading-anchor" href="#pages-body-excerpt" aria-hidden="true" tabindex="-1"></a></h3>
<p>Excerpt handling options.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">body:</span>
    <span class="hljs-attr">excerpt:</span>
      <span class="hljs-attr">separator:</span> <span class="hljs-string">excerpt|break</span> <span class="hljs-comment"># string to use as separator (`excerpt|break` by default)</span>
      <span class="hljs-attr">capture:</span> <span class="hljs-string">before</span>          <span class="hljs-comment"># part to capture, `before` or `after` the separator (`before` by default)</span></code></pre>
<h2 id="pages-default">pages.default<a class="heading-anchor" href="#pages-default" aria-hidden="true" tabindex="-1"></a></h2>
<p>Default pages are pages without content file (<strong>front matter only</strong>), indexed by ID, each one with a <code translate="no">path</code> and some front matter variables.</p>
<p>Cecil provides built-in default pages (from built-in templates):</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">default:</span>
    <span class="hljs-attr">index:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">''</span>
      <span class="hljs-attr">title:</span> <span class="hljs-string">Home</span>
      <span class="hljs-attr">published:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">404:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-number">404</span>
      <span class="hljs-attr">title:</span> <span class="hljs-string">Page</span> <span class="hljs-string">not</span> <span class="hljs-string">found</span>
      <span class="hljs-attr">layout:</span> <span class="hljs-number">404</span>
      <span class="hljs-attr">uglyurl:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">published:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">excluded:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">robots:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">robots</span>
      <span class="hljs-attr">title:</span> <span class="hljs-string">Robots.txt</span>
      <span class="hljs-attr">layout:</span> <span class="hljs-string">robots</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">txt</span>
      <span class="hljs-attr">published:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">excluded:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">multilingual:</span> <span class="hljs-literal">false</span>
    <span class="hljs-attr">sitemap:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">sitemap</span>
      <span class="hljs-attr">title:</span> <span class="hljs-string">XML</span> <span class="hljs-string">sitemap</span>
      <span class="hljs-attr">layout:</span> <span class="hljs-string">sitemap</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">xml</span>
      <span class="hljs-attr">changefreq:</span> <span class="hljs-string">monthly</span>
      <span class="hljs-attr">priority:</span> <span class="hljs-number">0.5</span>
      <span class="hljs-attr">published:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">excluded:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">multilingual:</span> <span class="hljs-literal">false</span>
    <span class="hljs-attr">xsl/sitemap:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">xsl/sitemap</span>
      <span class="hljs-attr">layout:</span> <span class="hljs-string">sitemap</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">xsl</span>
      <span class="hljs-attr">uglyurl:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">published:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">excluded:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">xsl/atom:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">xsl/atom</span>
      <span class="hljs-attr">layout:</span> <span class="hljs-string">feed</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">xsl</span>
      <span class="hljs-attr">uglyurl:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">published:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">excluded:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">xsl/rss:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">xsl/rss</span>
      <span class="hljs-attr">layout:</span> <span class="hljs-string">feed</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">xsl</span>
      <span class="hljs-attr">uglyurl:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">published:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">excluded:</span> <span class="hljs-literal">true</span></code></pre>
<p>Each one can be:</p>
<ol>
<li>disabled: <code translate="no">published: false</code></li>
<li>excluded from list pages: <code translate="no">excluded: true</code></li>
<li>excluded from localization: <code translate="no">multilingual: false</code></li>
</ol>
<p>You can also add your own pages (a theme can do the same in its <code translate="no">config.yml</code>):</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">default:</span>
    <span class="hljs-attr">code:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">code</span>
      <span class="hljs-attr">redirect:</span> <span class="hljs-string">https://github.com/ArnaudLigny</span></code></pre>
<p>Like any other page, a default page is listed (e.g.: in <code translate="no">site.pages.showable</code>, in the sitemap, on the homepage): set <code translate="no">excluded: true</code> to keep a technical page (JSON index, manifest, etc.) out of lists.</p>
<aside class="note note-important"><p>Since version <ins>9.19.0</ins>, <code translate="no">pages.virtual</code> is removed: move its pages to <code translate="no">pages.default</code>, indexed by ID (e.g.: the page path). Pages without content file are no longer excluded from lists by default.</p></aside>
<aside class="note note-tip"><p>Since version <ins>8.68.0</ins>, you can override the default <code translate="no">robots.txt</code> page by creating a page with the same <code translate="no">path</code>:</p>
<p><em>pages/robots.md</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">layout:</span> <span class="hljs-string">robots</span>
<span class="hljs-attr">output:</span> <span class="hljs-string">txt</span>
<span class="hljs-meta">---</span>
<span class="hljs-attr">User-agent:</span> <span class="hljs-string">AI-bot</span>
<span class="hljs-attr">Disallow:</span> <span class="hljs-string">/</span></code></pre></aside>
<h2 id="pages-generators">pages.generators<a class="heading-anchor" href="#pages-generators" aria-hidden="true" tabindex="-1"></a></h2>
<p>Generators are used by Cecil to create additional pages (e.g.: sitemap, feed, pagination, etc.) from existing pages, or from other sources like the configuration file or external sources.</p>
<p>Generators are indexed by name and run in ascending order of their priority. Below is the list of generators provided by Cecil:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">generators:</span>
    <span class="hljs-attr">DefaultPages:</span> <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\DefaultPages,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">10</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">ExternalBody:</span> <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\ExternalBody,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">30</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">Section:</span>      <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\Section,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">40</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">Taxonomy:</span>     <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\Taxonomy,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">50</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">Homepage:</span>     <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\Homepage,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">60</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">Pagination:</span>   <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\Pagination,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">70</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">Alias:</span>        <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\Alias,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">80</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">Redirect:</span>     <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Generator\Redirect,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">90</span> <span class="hljs-string">}</span></code></pre>
<p>A built-in generator can be disabled or moved by its name:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">generators:</span>
    <span class="hljs-attr">Redirect:</span> <span class="hljs-literal">false</span>            <span class="hljs-comment"># disabled</span>
    <span class="hljs-attr">Section:</span> <span class="hljs-string">{</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">45</span> <span class="hljs-string">}</span>  <span class="hljs-comment"># moved</span></code></pre>
<p>See <a href="/developers/extend/#configuration">Extensions</a> for the full syntax.</p>
<aside class="note note-tip"><p>You can extend Cecil with <a href="/developers/extend/#page-generators">Pages generator</a>.</p></aside>
<h2 id="pages-subsets">pages.subsets<a class="heading-anchor" href="#pages-subsets" aria-hidden="true" tabindex="-1"></a></h2>
<p>Subsets are used to render a part of the pages collection, based on a specific path, language or output format, with the command:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">cecil build --render-subset=&lt;name&gt;</code></pre>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">subsets:</span>
    <span class="hljs-string">&lt;name&gt;:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">&lt;path&gt;</span> <span class="hljs-comment"># glob or string path (e.g.: `blog/*`, `blog`)</span>
      <span class="hljs-attr">language:</span> <span class="hljs-string">&lt;language&gt;</span> <span class="hljs-comment"># language code (e.g.: `en`, `fr`)</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">&lt;output&gt;</span> <span class="hljs-comment"># output format (e.g.: `html`, `atom`)</span></code></pre>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">pages:</span>
  <span class="hljs-attr">subsets:</span>
    <span class="hljs-attr">blog_en:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">blog</span>
      <span class="hljs-attr">language:</span> <span class="hljs-string">en</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">html</span>
    <span class="hljs-attr">search_index:</span>
      <span class="hljs-attr">path:</span> <span class="hljs-string">'*'</span>
      <span class="hljs-attr">output:</span> <span class="hljs-string">json</span></code></pre>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/content/multilingual/</id>
    <title>Multilingual</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-24T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/content/multilingual/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Multilingual</h1>
<p>If your pages are available in multiple <a href="/configuration/languages/#languages">languages</a>, there are two ways to define them:</p>
<h2 id="through-file-name">Through file name<a class="heading-anchor" href="#through-file-name" aria-hidden="true" tabindex="-1"></a></h2>
<p>This is the most common way to translate a page from the main <a href="/configuration/languages/#language">language</a> to another language.</p>
<p>You just need to duplicate the reference page and add the target language <code translate="no">code</code> as a suffix, before the extension (e.g.: <code translate="no">about.fr.md</code>). The code must be one of the declared <a href="/configuration/languages/#languages">languages</a> (format <code translate="no">fr</code> or <code translate="no">fr-FR</code>).</p>
<p><em>Example:</em></p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">├─ about.md    # the reference page
└─ about.fr.md # the French version (`fr`)</code></pre>
<aside class="note note-tip"><p>You can change the URL of the translated page with the <code translate="no">slug</code> variable in its front matter. For example, in <code translate="no">about.fr.md</code>:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">slug:</span> <span class="hljs-string">a-propos</span>
<span class="hljs-meta">---</span>
<span class="hljs-comment"># about.md    -&gt; /about/</span>
<span class="hljs-comment"># about.fr.md -&gt; /fr/a-propos/</span></code></pre></aside>
<h2 id="through-front-matter">Through front matter<a class="heading-anchor" href="#through-front-matter" aria-hidden="true" tabindex="-1"></a></h2>
<p>If you want to create a page in a language other than the main language, without it being a translation of an existing page, you can use the <code translate="no">language</code> variable in its front matter.</p>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">language:</span> <span class="hljs-string">fr</span>
<span class="hljs-meta">---</span></code></pre>
<h2 id="link-translated-pages">Link translated pages<a class="heading-anchor" href="#link-translated-pages" aria-hidden="true" tabindex="-1"></a></h2>
<p>Each translated page references its versions in other languages.</p>
<p>This collection of pages is available in <a href="/templates/variables/#page">templates</a> with the following variable:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ page.translations }}</span></code></pre>
<aside class="note note-info"><p>Translations are linked by their <code translate="no">langref</code> variable: by default, the page path without language (e.g.: <code translate="no">about</code> for <code translate="no">about.md</code> and <code translate="no">about.fr.md</code>).</p>
<p>You can change it in the front matter, for example to link translated pages with different file names:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">langref:</span> <span class="hljs-string">my-page-ref</span>
<span class="hljs-meta">---</span></code></pre></aside>
<h2 id="search-engines">Search engines<a class="heading-anchor" href="#search-engines" aria-hidden="true" tabindex="-1"></a></h2>
<p>The built-in templates declare translated pages to search engines with <code translate="no">hreflang</code> alternates, in the HTML <code translate="no">&lt;head&gt;</code> and in the XML sitemap:</p>
<ul>
<li>each page lists itself and its translations</li>
<li><code translate="no">x-default</code> points to the version in the default language, and is omitted when the page has no version in the default language</li>
</ul>
<p>The XML sitemap lists the pages of all languages, including pages that are not translated into the default language.</p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/components/</id>
    <title>Components</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/components/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Components</h1>
<p>Cecil provides components to help you build reusable template "units".</p>
<aside class="note note-info"><p>The components feature is provided by the <a href="https://github.com/giorgiopogliani/twig-components" target="_blank" rel="noopener noreferrer"><em>Twig components extension</em></a> created by Giorgio Pogliani.</p></aside>
<h2 id="components-syntax">Components syntax<a class="heading-anchor" href="#components-syntax" aria-hidden="true" tabindex="-1"></a></h2>
<p>Components are Twig templates stored in the <code translate="no">components/</code> subdirectory of <code translate="no">layouts/</code> (e.g.: <code translate="no">layouts/components/button.twig</code>), and can be used anywhere in your templates:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/components/button.twig #}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> </span></span><span class="hljs-template-variable">{{ attributes.merge({class: 'rounded px-4'}) }}</span><span class="xml"><span class="hljs-tag">&gt;</span>
    </span><span class="hljs-template-variable">{{ slot }}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></span></code></pre>
<blockquote>
<p>The <code translate="no">slot</code> variable contains any content you add between the opening and closing tags.</p>
</blockquote>
<p>To use a component, use the dedicated tag <code translate="no">x</code> followed by <code translate="no">:</code> and the file name of your component without extension:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/index.html.twig #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name">x</span>:button with {class: 'text-white'} %}</span><span class="xml">
    <span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name">endx</span> %}</span></code></pre>
<p>It will render:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-white rounded px-4"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></code></pre>
<h3 id="html-syntax">HTML syntax<a class="heading-anchor" href="#html-syntax" aria-hidden="true" tabindex="-1"></a></h3>
<p>The same component can be used with an HTML-like syntax:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">x-button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-white"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">x-button</span>&gt;</span></span></code></pre>
<p>To evaluate an attribute value as a Twig expression, prefix its name with <code translate="no">:</code> (e.g.: <code translate="no">&lt;x-button :label="page.title"&gt;</code>).</p>
<h3 id="subfolders">Subfolders<a class="heading-anchor" href="#subfolders" aria-hidden="true" tabindex="-1"></a></h3>
<p>Components stored in subfolders are reached with the <em>dot notation</em>:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/components/button/primary.twig #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name">x</span>:button.primary %}</span><span class="xml">Click me</span><span class="hljs-template-tag">{% <span class="hljs-name">endx</span> %}</span><span class="xml">
</span><span class="hljs-comment">{# or #}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">x-button.primary</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">x-button.primary</span>&gt;</span></span></code></pre>
<h3 id="named-slots">Named slots<a class="heading-anchor" href="#named-slots" aria-hidden="true" tabindex="-1"></a></h3>
<p>A component can expose several named slots:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/components/card.twig #}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> </span></span><span class="hljs-template-variable">{{ attributes.class('card') }}</span><span class="xml"><span class="hljs-tag">&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span> </span></span><span class="hljs-template-variable">{{ title.attributes.class('card-title') }}</span><span class="xml"><span class="hljs-tag">&gt;</span></span><span class="hljs-template-variable">{{ title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span></span><span class="hljs-template-variable">{{ body }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">x</span>:card %}</span><span class="xml">
    </span><span class="hljs-template-tag">{% <span class="hljs-name">slot</span>:title with {class: 'text-2xl'} %}</span><span class="xml">Title</span><span class="hljs-template-tag">{% <span class="hljs-name">endslot</span> %}</span><span class="xml">
    </span><span class="hljs-template-tag">{% <span class="hljs-name">slot</span>:body %}</span><span class="xml">Body</span><span class="hljs-template-tag">{% <span class="hljs-name">endslot</span> %}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name">endx</span> %}</span><span class="xml">
</span><span class="hljs-comment">{# or #}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">x-card</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">x-slot</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"title"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-2xl"</span>&gt;</span>Title<span class="hljs-tag">&lt;/<span class="hljs-name">x-slot</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">x-slot</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"body"</span>&gt;</span>Body<span class="hljs-tag">&lt;/<span class="hljs-name">x-slot</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">x-card</span>&gt;</span></span></code></pre>
<h2 id="configuration">Configuration<a class="heading-anchor" href="#configuration" aria-hidden="true" tabindex="-1"></a></h2>
<p>The components directory and file extension can be changed with the <a href="/configuration/layouts/#layouts-components"><code translate="no">layouts.components</code></a> options (<code translate="no">dir</code>, <code translate="no">components</code> by default, and <code translate="no">ext</code>, <code translate="no">twig</code> by default).</p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/data-static/</id>
    <title>Data and static files</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/data-static/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Data and static files</h1>
<p>These options define where data files and static files are stored and how they are handled.</p>
<h2 id="data">Data<a class="heading-anchor" href="#data" aria-hidden="true" tabindex="-1"></a></h2>
<p>Where data files are stored and what extensions are handled.</p>
<p>Supported formats: YAML, JSON, XML and CSV.</p>
<h3 id="data-dir">data.dir<a class="heading-anchor" href="#data-dir" aria-hidden="true" tabindex="-1"></a></h3>
<p>Data source directory (<code translate="no">data</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">data:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">data</span></code></pre>
<h3 id="data-ext">data.ext<a class="heading-anchor" href="#data-ext" aria-hidden="true" tabindex="-1"></a></h3>
<p>List of file extensions.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">data:</span>
  <span class="hljs-attr">ext:</span> <span class="hljs-string">[yaml,</span> <span class="hljs-string">yml,</span> <span class="hljs-string">json,</span> <span class="hljs-string">xml,</span> <span class="hljs-string">csv]</span></code></pre>
<h3 id="data-load">data.load<a class="heading-anchor" href="#data-load" aria-hidden="true" tabindex="-1"></a></h3>
<p>Enables <code translate="no">site.data</code> collection (<code translate="no">true</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">data:</span>
  <span class="hljs-attr">load:</span> <span class="hljs-literal">true</span></code></pre>
<hr>
<h2 id="static">Static<a class="heading-anchor" href="#static" aria-hidden="true" tabindex="-1"></a></h2>
<p>Management of static files, copied as is (PDF, fonts, etc.).</p>
<aside class="note note-important"><p>You should put your assets files, used by <a href="/assets/#asset"><code translate="no">asset()</code></a>, in the <a href="/documentation/assets/#assets-dir"><code translate="no">assets</code> directory</a> to avoid unnecessary files copy.</p></aside>
<h3 id="static-dir">static.dir<a class="heading-anchor" href="#static-dir" aria-hidden="true" tabindex="-1"></a></h3>
<p>Static files source directory (<code translate="no">static</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">static:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">static</span></code></pre>
<h3 id="static-target">static.target<a class="heading-anchor" href="#static-target" aria-hidden="true" tabindex="-1"></a></h3>
<p>Directory where static files are copied (root by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">static:</span>
  <span class="hljs-attr">target:</span> <span class="hljs-string">''</span></code></pre>
<h3 id="static-exclude">static.exclude<a class="heading-anchor" href="#static-exclude" aria-hidden="true" tabindex="-1"></a></h3>
<p>List of excluded files. Accepts globs, strings and regexes.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">static:</span>
  <span class="hljs-attr">exclude:</span> <span class="hljs-string">['sass',</span> <span class="hljs-string">'scss'</span><span class="hljs-string">,</span> <span class="hljs-string">'*.scss'</span><span class="hljs-string">,</span> <span class="hljs-string">'package*.json'</span><span class="hljs-string">,</span> <span class="hljs-string">'node_modules'</span><span class="hljs-string">]</span></code></pre>
<aside class="note note-tip"><p>If you use <a href="https://icons.getbootstrap.com" target="_blank" rel="noopener noreferrer">Bootstrap Icons</a> you can exclude the <code translate="no">node_modules</code> except <code translate="no">node_modules/bootstrap-icons</code> with a regular expression:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">static:</span>
  <span class="hljs-attr">exclude:</span> <span class="hljs-string">['sass',</span> <span class="hljs-string">'scss'</span><span class="hljs-string">,</span> <span class="hljs-string">'*.scss'</span><span class="hljs-string">,</span> <span class="hljs-string">'package*.json'</span><span class="hljs-string">,</span> <span class="hljs-string">'#node_modules/(?!bootstrap-icons)#'</span><span class="hljs-string">]</span></code></pre></aside>
<h3 id="static-load">static.load<a class="heading-anchor" href="#static-load" aria-hidden="true" tabindex="-1"></a></h3>
<p>Enables <code translate="no">site.static</code> collection (<code translate="no">false</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">static:</span>
  <span class="hljs-attr">load:</span> <span class="hljs-literal">false</span></code></pre>
<h3 id="static-mounts">static.mounts<a class="heading-anchor" href="#static-mounts" aria-hidden="true" tabindex="-1"></a></h3>
<p>Copies specific files or directories to a specific destination: each entry maps a source path, relative to the <a href="#static-dir"><code translate="no">static.dir</code></a> directory, to a destination path, relative to the output directory.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">static:</span>
  <span class="hljs-attr">mounts:</span>
    <span class="hljs-string">&lt;source&gt;:</span> <span class="hljs-string">&lt;destination&gt;</span></code></pre>
<h3 id="static-example">static example<a class="heading-anchor" href="#static-example" aria-hidden="true" tabindex="-1"></a></h3>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">static:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">docs</span>
  <span class="hljs-attr">target:</span> <span class="hljs-string">docs</span>
  <span class="hljs-attr">exclude:</span> <span class="hljs-string">['sass',</span> <span class="hljs-string">'*.scss'</span><span class="hljs-string">,</span> <span class="hljs-string">'/\.bck$/'</span><span class="hljs-string">]</span>
  <span class="hljs-attr">load:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">mounts:</span>
    <span class="hljs-attr">source/path/file.ext:</span> <span class="hljs-string">dest/path/file.ext</span>
    <span class="hljs-attr">vendor/icons/fonts:</span> <span class="hljs-string">fonts</span></code></pre>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/content/dynamic-content/</id>
    <title>Dynamic content</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/content/dynamic-content/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Dynamic content</h1>
<p>By default, the body of a page is static: Twig syntax written in a Markdown file is output as is.</p>
<p>You can create dynamic content in a page by using the <a href="https://twig.symfony.com/doc/3.x/functions/template_from_string.html" target="_blank" rel="noopener noreferrer"><code translate="no">template_from_string</code></a> Twig function, which renders the page content as a Twig template.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ <span class="hljs-name">include</span><span class="hljs-params">(template_from_string(page.content, "dynamic content for page " ~ page.id)</span>) }}</span></code></pre>
<p>With this, you can use any page variable in the <em>body</em> of the page.</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">---
<span class="hljs-section">var: 'value'
---</span>
The value of <span class="hljs-code">`var`</span> is {{ page.var }}.</code></pre>
<h2 id="enable-dynamic-content">Enable dynamic content<a class="heading-anchor" href="#enable-dynamic-content" aria-hidden="true" tabindex="-1"></a></h2>
<p>The recommended way is to create a dedicated layout that overrides the <code translate="no">content</code> block, and to use it only for pages that need it.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/dynamic.html.twig #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">extends</span></span> '_default/page.html.twig' %}</span><span class="xml">

</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">block</span></span> content %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ <span class="hljs-name">include</span><span class="hljs-params">(template_from_string(page.content, "dynamic content for page " ~ page.id)</span>) }}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endblock</span></span> content %}</span></code></pre>
<p>Then set the <a href="/documentation/front-matter/#predefined-variables"><code translate="no">layout</code></a> variable in the front matter of the page:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-meta">---</span>
<span class="hljs-attr">title:</span> <span class="hljs-string">"My dynamic page"</span>
<span class="hljs-attr">layout:</span> <span class="hljs-string">dynamic</span>
<span class="hljs-meta">---</span></code></pre>
<aside class="note note-tip"><p>The second argument of <code translate="no">template_from_string</code> is the name of the template: it is displayed in error messages, so including <code translate="no">page.id</code> helps to find the page in error.</p></aside>
<h2 id="available-variables">Available variables<a class="heading-anchor" href="#available-variables" aria-hidden="true" tabindex="-1"></a></h2>
<p>The page content is rendered with the same context as the layout, so you can use:</p>
<ul>
<li>page variables: <code translate="no">page.title</code>, <code translate="no">page.date</code>, <code translate="no">page.&lt;custom variable&gt;</code>, etc.</li>
<li>site variables: <code translate="no">site.title</code>, <code translate="no">site.pages</code>, <a href="/templates/variables/#site-data"><code translate="no">site.data</code></a>, etc.</li>
<li>all <a href="/templates/reference/functions/">functions</a>, <a href="/templates/reference/filters/">filters</a> and <a href="/templates/reference/sorts/">sorts</a> available in templates</li>
<li>Twig tags: <code translate="no">{% set %}</code>, <code translate="no">{% if %}</code>, <code translate="no">{% for %}</code>, <code translate="no">{% include %}</code>, etc.</li>
</ul>
<h2 id="how-it-works">How it works<a class="heading-anchor" href="#how-it-works" aria-hidden="true" tabindex="-1"></a></h2>
<p>The Markdown body is <strong>converted to HTML first</strong>, then the result (<code translate="no">page.content</code>) is rendered by Twig. This order has some consequences:</p>
<ul>
<li>Markdown escapes the <code translate="no">&lt;</code> and <code translate="no">&gt;</code> characters, so comparison operators (<code translate="no">&gt;</code>, <code translate="no">&lt;=</code>) and arrow functions (<code translate="no">=&gt;</code>) can’t be used in the body: the build fails with an <code translate="no">Unexpected character "&amp;"</code> error.</li>
<li>A Twig expression used in an HTML attribute (e.g.: <code translate="no">href="{{ url(post) }}"</code>) is URL encoded by the Markdown converter and won’t be evaluated.</li>
<li>A Twig expression alone on its own line is wrapped in a <code translate="no">&lt;p&gt;</code> element.</li>
<li>Twig syntax written inside a code span or a code block <strong>is</strong> evaluated too.</li>
</ul>
<aside class="note note-tip"><p>Keep the body simple (variables, filters, short conditions) and move complex markup and logic into a <a href="#example-include-a-partial-template">partial template</a> or a <a href="#example-shortcodes-with-macros">macro</a>.</p></aside>
<p>To display Twig syntax as is, wrap it in a <code translate="no">verbatim</code> tag:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">verbatim</span></span> %}</span><span class="xml">`</span><span class="hljs-template-variable">{{ page.title }}</span><span class="xml">`</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endverbatim</span></span> %}</span></code></pre>
<p>To avoid an extra <code translate="no">&lt;p&gt;</code> element around a block of HTML, wrap the expression in an HTML element, separated by line breaks:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
</span><span class="hljs-template-variable">{{ <span class="hljs-name">include</span><span class="hljs-params">('partials/latest-posts.html.twig')</span> }}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span></code></pre>
<h2 id="example-include-a-partial-template">Example: variables, data and partial template<a class="heading-anchor" href="#example-include-a-partial-template" aria-hidden="true" tabindex="-1"></a></h2>
<p>This example shows a page displaying site and page variables, data from a <a href="/templates/variables/#site-data">data file</a>, and the latest blog posts through a reusable partial template.</p>
<p>Data file:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-comment"># data/team.yml</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Alice</span>
  <span class="hljs-attr">role:</span> <span class="hljs-string">Developer</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Bob</span>
  <span class="hljs-attr">role:</span> <span class="hljs-string">Designer</span></code></pre>
<p>Partial template, which receives <code translate="no">section</code> and <code translate="no">limit</code> as parameters:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/partials/latest-posts.html.twig #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> posts = site.pages.showable|filter_by('section', section|<span class="hljs-keyword">default</span>('blog'))|sort_by_date|<span class="hljs-keyword">slice</span>(0, limit|<span class="hljs-keyword">default</span>(5)) %}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">if</span></span> posts|<span class="hljs-keyword">length</span> &gt; 0 %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"latest-posts"</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">for</span></span> post in posts %}</span><span class="xml">
  <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(post) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ post.title }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">time</span> <span class="hljs-attr">datetime</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ post.<span class="hljs-name">date</span>|<span class="hljs-keyword">date</span>('Y-m-d') }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span><span class="hljs-template-variable">{{ post.<span class="hljs-name">date</span>|format_date('long') }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">time</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
  </span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endfor</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name">else</span> %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>No posts yet.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endif</span></span> %}</span></code></pre>
<p>Page:</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">---
title: About
<span class="hljs-section">layout: dynamic
---</span>
Welcome to <span class="hljs-strong">**{{ site.title }}**</span>! This page was published on {{ page.date|format_date('long') }}.

Our team has {{ site.data.team|length }} members: {{ site.data.team|column('name')|join(', ') }}.

<span class="hljs-section">## Latest posts</span>

<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span></span>
{{ include('partials/latest-posts.html.twig', {section: 'blog', limit: 3}) }}
<span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span></code></pre>
<p>Output:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Welcome to <span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>My site<span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span>! This page was published on October 9, 2026.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Our team has 2 members: Alice, Bob.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">h2</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"latest-posts"</span>&gt;</span>Latest posts<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"latest-posts"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/blog/post-3/"</span>&gt;</span>Post 3<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">time</span> <span class="hljs-attr">datetime</span>=<span class="hljs-string">"2026-03-01"</span>&gt;</span>March 1, 2026<span class="hljs-tag">&lt;/<span class="hljs-name">time</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/blog/post-2/"</span>&gt;</span>Post 2<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">time</span> <span class="hljs-attr">datetime</span>=<span class="hljs-string">"2026-02-01"</span>&gt;</span>February 1, 2026<span class="hljs-tag">&lt;/<span class="hljs-name">time</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/blog/post-1/"</span>&gt;</span>Post 1<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-name">time</span> <span class="hljs-attr">datetime</span>=<span class="hljs-string">"2026-01-01"</span>&gt;</span>January 1, 2026<span class="hljs-tag">&lt;/<span class="hljs-name">time</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></code></pre>
<aside class="note note-info"><p>The <code translate="no">&gt;</code> operator and the <code translate="no">href="{{ … }}"</code> attribute work here because they are written in the partial template, not in the Markdown body.</p></aside>
<h2 id="example-shortcodes-with-macros">Example: shortcodes with macros<a class="heading-anchor" href="#example-shortcodes-with-macros" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="https://twig.symfony.com/doc/3.x/tags/macro.html" target="_blank" rel="noopener noreferrer">Twig macros</a> can be used as <em>shortcodes</em> to insert rich HTML snippets in the body of a page.</p>
<p>Create the macros:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/macros/shortcodes.html.twig #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">macro</span></span> youtube(id, title = 'YouTube video') %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">iframe</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://www.youtube-nocookie.com/embed/</span></span></span><span class="hljs-template-variable">{{ id }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">title</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ title }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"560"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"315"</span> <span class="hljs-attr">loading</span>=<span class="hljs-string">"lazy"</span> <span class="hljs-attr">allowfullscreen</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">iframe</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endmacro</span></span> %}</span><span class="xml">

</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">macro</span></span> alert(message, type = 'info') %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"alert alert-</span></span></span><span class="hljs-template-variable">{{ type }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"alert"</span>&gt;</span></span><span class="hljs-template-variable">{{ message }}</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endmacro</span></span> %}</span></code></pre>
<p>Create a layout that imports the macros before rendering the content:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-comment">{# layouts/shortcodes.html.twig #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">extends</span></span> '_default/page.html.twig' %}</span><span class="xml">

</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">block</span></span> content %}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> imports = "{% import 'macros/shortcodes.html.twig' as sc %}</span><span class="xml">" %}
</span><span class="hljs-template-variable">{{ <span class="hljs-name">include</span><span class="hljs-params">(template_from_string(imports ~ page.content, "dynamic content for page " ~ page.id)</span>) }}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endblock</span></span> content %}</span></code></pre>
<p>Use the shortcodes in a page:</p>
<pre data-lang="markdown"><code class="language-markdown hljs markdown" translate="no">---
title: "Demo video"
<span class="hljs-section">layout: shortcodes
---</span>
<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span></span>
  {{ sc.alert('This video is in English.', 'warning') }}
<span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>

<span class="hljs-section">## Demo</span>

<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span></span>
  {{ sc.youtube('NaB8JBfE7DY', 'Cecil demo') }}
<span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span></code></pre>
<p>Output:</p>
<pre data-lang="html"><code class="language-html hljs xml" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"alert alert-warning"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"alert"</span>&gt;</span>This video is in English.<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">h2</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"demo"</span>&gt;</span>Demo<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">iframe</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://www.youtube-nocookie.com/embed/NaB8JBfE7DY"</span> <span class="hljs-attr">title</span>=<span class="hljs-string">"Cecil demo"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"560"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"315"</span> <span class="hljs-attr">loading</span>=<span class="hljs-string">"lazy"</span> <span class="hljs-attr">allowfullscreen</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">iframe</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></code></pre>
<aside class="note note-tip"><p>To reuse UI elements across templates and pages, see also <a href="/templates/components/">components</a>.</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/localization/</id>
    <title>Localization</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/localization/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Localization</h1>
<p>Cecil supports <a href="#text-translation">text translation</a> and <a href="#date-localization">date localization</a>.</p>
<h2 id="text-translation">Text translation<a class="heading-anchor" href="#text-translation" aria-hidden="true" tabindex="-1"></a></h2>
<p>Use the <code translate="no">trans</code> <em>tag</em> or <em>filter</em> to translate texts in templates.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">trans</span> with variables into locale %}</span><span class="hljs-template-tag">{% <span class="hljs-name">endtrans</span> %}</span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ message|trans(variables = []) }}</span></code></pre>
<h3 id="examples">Examples<a class="heading-anchor" href="#examples" aria-hidden="true" tabindex="-1"></a></h3>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">trans</span> %}</span><span class="xml">Hello World!</span><span class="hljs-template-tag">{% <span class="hljs-name">endtrans</span> %}</span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ message|trans }}</span></code></pre>
<p>Include variables:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">trans</span> with {'%name%': 'Arnaud'} %}</span><span class="xml">Hello %name%!</span><span class="hljs-template-tag">{% <span class="hljs-name">endtrans</span> %}</span></code></pre>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ message|trans({'%name%': 'Arnaud'}) }}</span></code></pre>
<p>Force locale:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">trans</span> into 'fr_FR' %}</span><span class="xml">Hello World!</span><span class="hljs-template-tag">{% <span class="hljs-name">endtrans</span> %}</span></code></pre>
<p>Pluralize:</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">trans</span> with {'%count%': 42} %}</span><span class="xml">{0}I don't have apples|{1}I have one apple|]1,Inf[I have %count% apples</span><span class="hljs-template-tag">{% <span class="hljs-name">endtrans</span> %}</span></code></pre>
<h2 id="translation-files">Translation files<a class="heading-anchor" href="#translation-files" aria-hidden="true" tabindex="-1"></a></h2>
<p>Translation files must be named <code translate="no">messages.&lt;locale&gt;.&lt;extension&gt;</code> and stored in the <a href="/configuration/layouts/#layouts-translations"><code translate="no">translations</code></a> directory.<br>
Supported file extensions are defined by each translation format in <a href="/configuration/layouts/#layouts-translations"><code translate="no">layouts.translations.formats</code></a>.</p>
<p>The locale code (e.g.: <code translate="no">fr_FR</code>) of a language is defined in the <a href="/configuration/languages/#languages"><code translate="no">languages</code></a> entries of the configuration. A file named with the language code only (e.g.: <code translate="no">messages.fr.yaml</code>) is also loaded, and the translations of the <a href="/documentation/extend/#theme">themes</a> are merged with those of the site.</p>
<p><em>Example:</em></p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">&lt;my-site&gt;
└─ translations
   ├─ messages.fr_FR.mo   &lt;- Machine Object format
   └─ messages.fr_FR.yaml &lt;- YAML format</code></pre>
<aside class="note note-info"><p>You can easily extract translations from your templates with the following command:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar util:translations:extract --locale=&lt;code&gt; --show</code></pre>
<p>Use <code translate="no">--save</code> instead of (or in addition to) <code translate="no">--show</code> to save the translations to a file. The <code translate="no">--locale</code> option is required. The default output format is <code translate="no">yaml</code> (use <code translate="no">--format=po</code> for gettext PO format).</p></aside>
<aside class="note note-tip"><p><a href="https://poedit.net" target="_blank" rel="noopener noreferrer"><em>Poedit</em></a> is a simple and cross-platform translation editor for gettext (PO), and <a href="https://poedit.net/pro" target="_blank" rel="noopener noreferrer"><em>Poedit Pro</em></a> supports extraction of translation strings from templates out of the box.</p></aside>
<aside class="note note-important"><p>Translations are <a href="/documentation/cache/">cached</a>: the cache is refreshed when a translation file is updated or removed, but not when a new one is added.</p>
<p>Cache can be cleared with the following command:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar cache:clear:translations</code></pre></aside>
<h2 id="date-localization">Date localization<a class="heading-anchor" href="#date-localization" aria-hidden="true" tabindex="-1"></a></h2>
<p>Use the Twig <a href="https://twig.symfony.com/doc/3.x/filters/format_date.html" target="_blank" rel="noopener noreferrer"><code translate="no">format_date</code></a> filter to localize a date in templates.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ page.<span class="hljs-name">date</span>|format_date('long') }}</span><span class="xml">
</span><span class="hljs-comment">{# September 30, 2022 #}</span></code></pre>
<p>Supported values are: <code translate="no">none</code>, <code translate="no">short</code>, <code translate="no">medium</code>, <code translate="no">long</code>, and <code translate="no">full</code>.</p>
<p>The <a href="https://twig.symfony.com/doc/3.x/filters/format_datetime.html" target="_blank" rel="noopener noreferrer"><code translate="no">format_datetime</code></a> and <a href="https://twig.symfony.com/doc/3.x/filters/format_time.html" target="_blank" rel="noopener noreferrer"><code translate="no">format_time</code></a> filters are also available.</p>
<aside class="note note-important"><p>If you want to use these filters <strong>with locales other than "en"</strong>, you should <a href="https://php.net/intl.setup" target="_blank" rel="noopener noreferrer">install the intl PHP extension</a>.</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/assets/</id>
    <title>Assets</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/assets/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Assets</h1>
<p>Assets management (images, CSS and JS files).</p>
<h2 id="assets-dir">assets.dir<a class="heading-anchor" href="#assets-dir" aria-hidden="true" tabindex="-1"></a></h2>
<p>Assets source directory (<code translate="no">assets</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">assets</span></code></pre>
<h2 id="assets-target">assets.target<a class="heading-anchor" href="#assets-target" aria-hidden="true" tabindex="-1"></a></h2>
<p>Directory where remote and resized assets files are saved (root by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">target:</span> <span class="hljs-string">''</span></code></pre>
<h2 id="assets-fingerprint">assets.fingerprint<a class="heading-anchor" href="#assets-fingerprint" aria-hidden="true" tabindex="-1"></a></h2>
<p>Enables fingerprinting (cache busting) for assets files (<code translate="no">true</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">fingerprint:</span> <span class="hljs-literal">true</span></code></pre>
<h2 id="assets-compile">assets.compile<a class="heading-anchor" href="#assets-compile" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="https://sass-lang.com" target="_blank" rel="noopener noreferrer">Sass</a> files compilation options. See the <a href="https://scssphp.github.io/scssphp/docs/#output-formatting" target="_blank" rel="noopener noreferrer">documentation of scssphp</a> for options details.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">compile:</span>
    <span class="hljs-attr">style:</span> <span class="hljs-string">expanded</span>      <span class="hljs-comment"># compilation style (`expanded` or `compressed`. `expanded` by default)</span>
    <span class="hljs-attr">import:</span> <span class="hljs-string">[sass,</span> <span class="hljs-string">scss]</span> <span class="hljs-comment"># list of imported paths (`[sass, scss, node_modules]` by default)</span>
    <span class="hljs-attr">sourcemap:</span> <span class="hljs-literal">false</span>     <span class="hljs-comment"># enables sourcemap in debug mode (`false` by default)</span>
    <span class="hljs-attr">variables:</span> <span class="hljs-string">{}</span>        <span class="hljs-comment"># preset variables, as `name: value` pairs (empty by default)</span></code></pre>
<aside class="note note-info"><p><code translate="no">sourcemap</code> is used to debug SCSS compilation (<a href="/documentation/site/#debug">debug mode</a> must be enabled).</p></aside>
<h2 id="assets-minify">assets.minify<a class="heading-anchor" href="#assets-minify" aria-hidden="true" tabindex="-1"></a></h2>
<p>Enables CSS and JS minification (<code translate="no">true</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">minify:</span> <span class="hljs-literal">true</span></code></pre>
<h2 id="assets-images">assets.images<a class="heading-anchor" href="#assets-images" aria-hidden="true" tabindex="-1"></a></h2>
<p>Images management.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">optimize:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># enables images optimization with JpegOptim, Optipng, Pngquant 2, SVGO 1, Gifsicle, cwebp, avifenc (`false` by default)</span>
    <span class="hljs-attr">quality:</span> <span class="hljs-number">75</span>     <span class="hljs-comment"># image quality used by optimization and resizing (`75` by default)</span>
    <span class="hljs-attr">responsive:</span>
      <span class="hljs-attr">widths:</span> <span class="hljs-string">[480,</span> <span class="hljs-number">640</span><span class="hljs-string">,</span> <span class="hljs-number">768</span><span class="hljs-string">,</span> <span class="hljs-number">1024</span><span class="hljs-string">,</span> <span class="hljs-number">1366</span><span class="hljs-string">,</span> <span class="hljs-number">1600</span><span class="hljs-string">,</span> <span class="hljs-number">1920</span><span class="hljs-string">]</span> <span class="hljs-comment"># `srcset` attribute images widths</span>
      <span class="hljs-attr">sizes:</span>
        <span class="hljs-attr">default:</span> <span class="hljs-string">'100vw'</span> <span class="hljs-comment"># default `sizes` attribute (`100vw` by default)</span>
      <span class="hljs-attr">densities:</span> <span class="hljs-string">[1,</span> <span class="hljs-number">2</span><span class="hljs-string">,</span> <span class="hljs-number">3</span><span class="hljs-string">]</span> <span class="hljs-comment"># `srcset` attribute pixel densities</span></code></pre>
<h2 id="assets-images-cdn">assets.images.cdn<a class="heading-anchor" href="#assets-images-cdn" aria-hidden="true" tabindex="-1"></a></h2>
<p>URL of image assets can be easily replaced by a provided CDN <code translate="no">url</code>.</p>
<pre data-lang="yaml"><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">false</span>  <span class="hljs-comment"># enables Image CDN (`false` by default)</span>
      <span class="hljs-attr">svg:</span> <span class="hljs-literal">false</span>      <span class="hljs-comment"># includes SVG images (`false` by default)</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">true</span> <span class="hljs-comment"># `image_url` is canonical (instead of a relative path) (`true` by default)</span>
      <span class="hljs-attr">remote:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># also handles remote images (`true` by default)</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span> <span class="hljs-comment"># provider account</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://provider.tld/%account%/%image_url%?w=%width%&amp;q=%quality%&amp;format=%format%'</span></code></pre>
<p><code translate="no">url</code> is a pattern that contains variables:</p>
<ul>
<li><code translate="no">%account%</code> replaced by the <code translate="no">assets.images.cdn.account</code> option</li>
<li><code translate="no">%image_url%</code> replaced by the image canonical URL or <code translate="no">path</code></li>
<li><code translate="no">%width%</code> replaced by the image width</li>
<li><code translate="no">%quality%</code> replaced by the <code translate="no">assets.images.quality</code> option</li>
<li><code translate="no">%format%</code> replaced by the image format</li>
</ul>
<p>See <a href="/assets/cdn-providers/"><strong>CDN providers</strong></a>.</p>
<h2 id="assets-remote-useragent">assets.remote.useragent<a class="heading-anchor" href="#assets-remote-useragent" aria-hidden="true" tabindex="-1"></a></h2>
<p>User agent used to download remote assets.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">remote:</span>
    <span class="hljs-attr">useragent:</span>
      <span class="hljs-attr">default:</span> <span class="hljs-string">&lt;string&gt;</span> <span class="hljs-comment"># user agent of HTTP requests</span></code></pre>
<aside class="note note-info"><p>For a given asset, the user agent can be replaced with the <code translate="no">useragent</code> option of the <a href="/assets/#asset"><code translate="no">asset()</code></a> function.</p></aside>
<h2 id="assets-remote-timeout">assets.remote.timeout<a class="heading-anchor" href="#assets-remote-timeout" aria-hidden="true" tabindex="-1"></a></h2>
<p>Timeout of remote assets downloads, in seconds (<code translate="no">30</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">remote:</span>
    <span class="hljs-attr">timeout:</span> <span class="hljs-number">30</span></code></pre>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/cache/</id>
    <title>Cache</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/cache/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Cache</h1>
<p>Cecil uses a cache system to speed up the generation process; it can be disabled or cleared.</p>
<p>There are three cache types involved in template rendering: templates, <a href="/assets/#asset">assets</a>, and <a href="/documentation/localization/#translation-files">translations</a>.</p>
<h2 id="clear-cache">Clear cache<a class="heading-anchor" href="#clear-cache" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can clear the cache with the following commands:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar cache:clear               <span class="hljs-comment"># clear all caches</span>
php cecil.phar cache:clear:assets        <span class="hljs-comment"># clear assets cache</span>
php cecil.phar cache:clear:templates     <span class="hljs-comment"># clear templates cache</span>
php cecil.phar cache:clear:translations  <span class="hljs-comment"># clear translations cache</span></code></pre>
<aside class="note note-important"><p>In practice you don’t need to clear the cache manually: Cecil does it for you when needed (e.g. when files change).</p></aside>
<h2 id="fragments-cache">Fragments cache<a class="heading-anchor" href="#fragments-cache" aria-hidden="true" tabindex="-1"></a></h2>
<p>Cecil provides a way to cache parts of templates rendering to avoid re-rendering the same partial content multiple times.</p>
<p>To use <em>fragments</em> cache, wrap the content you want to cache with the <a href="https://twig.symfony.com/doc/tags/cache.html" target="_blank" rel="noopener noreferrer"><code translate="no">cache</code> tag</a>.</p>
<pre data-lang="twig"><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name">cache</span> 'unique-key' %}</span><span class="xml">
  </span><span class="hljs-comment">{# cacheable content #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name">endcache</span> %}</span></code></pre>
<aside class="note note-tip"><p>You should use the <a href="/documentation/reference/functions/#cache-key"><code translate="no">cache_key</code> function</a> to be sure to have a unique cache key for each content you want to cache.</p></aside>
<aside class="note note-warning"><p><em>Fragments</em> cache is persistent, so if the cache key is too generic, you may end up with wrong content displayed.</p></aside>
<p>To clear fragments cache only, use the following command:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar cache:clear:templates --fragments</code></pre>
<h2 id="disable-cache">Disable cache<a class="heading-anchor" href="#disable-cache" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can disable cache with the <a href="/configuration/cache/">configuration</a>.</p>
<aside class="note note-warning"><p>Disabling cache can slow down the generation process, so it’s not recommended.</p>
<p>During local development, if you need to clear cache before each generation, you can use the following option:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar serve --clear-cache          <span class="hljs-comment"># clear all caches</span>
php cecil.phar serve --clear-cache=&lt;regex&gt;  <span class="hljs-comment"># clear cache for cache keys matching the regular expression &lt;regex&gt;</span></code></pre>
<p>Example:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar serve --clear-cache=css  <span class="hljs-comment"># clear cache for all CSS files</span></code></pre></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/layouts/</id>
    <title>Layouts</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-26T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/layouts/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Layouts</h1>
<p>Templates options.</p>
<h2 id="layouts-dir">layouts.dir<a class="heading-anchor" href="#layouts-dir" aria-hidden="true" tabindex="-1"></a></h2>
<p>Templates source directory (<code translate="no">layouts</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">layouts</span></code></pre>
<h2 id="layouts-autoescape">layouts.autoescape<a class="heading-anchor" href="#layouts-autoescape" aria-hidden="true" tabindex="-1"></a></h2>
<p>Overrides Twig <code translate="no">autoescape</code> option (<code translate="no">false</code> by default).</p>
<p>If set to <code translate="no">null</code>, Cecil uses an extension-based strategy:</p>
<ul>
<li><code translate="no">*.js.twig</code> -&gt; <code translate="no">js</code></li>
<li><code translate="no">*.css.twig</code> -&gt; <code translate="no">css</code></li>
<li><code translate="no">*.html.twig</code> and <code translate="no">*.twig</code> -&gt; <code translate="no">html</code></li>
<li>any other extension -&gt; <code translate="no">false</code></li>
</ul>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">autoescape:</span> <span class="hljs-literal">false</span>  <span class="hljs-comment"># disables automatic escaping (default)</span>
  <span class="hljs-comment">#autoescape: null  # use Cecil automatic strategy by template filename extension</span>
  <span class="hljs-comment">#autoescape: html</span>
  <span class="hljs-comment">#autoescape: js</span></code></pre>
<h2 id="layouts-images">layouts.images<a class="heading-anchor" href="#layouts-images" aria-hidden="true" tabindex="-1"></a></h2>
<p>Images handling options.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">formats:</span> <span class="hljs-string">[]</span>       <span class="hljs-comment"># used by `html` function: adds alternative image formats as `source` (e.g. `[avif, webp]`, empty array by default)</span>
    <span class="hljs-attr">responsive:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># used by `html` function: adds responsive images ('width' or 'density', `false` by default)</span>
    <span class="hljs-attr">placeholder:</span> <span class="hljs-string">''</span>   <span class="hljs-comment"># used by `html` function: fills image background before loading (`color` or `lqip`, disabled by default)</span>
    <span class="hljs-attr">dark_suffix:</span> <span class="hljs-string">~</span>    <span class="hljs-comment"># suffix of the dark variant image (e.g. `.dark`), disabled by default</span>
    <span class="hljs-attr">mobile_suffix:</span> <span class="hljs-string">~</span>  <span class="hljs-comment"># suffix of the mobile variant image (e.g. `.mobile`), disabled by default</span>
    <span class="hljs-attr">mobile_media_query:</span> <span class="hljs-string">'(max-width: 767px)'</span> <span class="hljs-comment"># media query of the mobile variant `&lt;source&gt;`</span></code></pre>
<h2 id="layouts-highlight">layouts.highlight<a class="heading-anchor" href="#layouts-highlight" aria-hidden="true" tabindex="-1"></a></h2>
<p>Code syntax highlighting options of templates.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">highlight:</span>
    <span class="hljs-attr">engine:</span> <span class="hljs-string">highlightjs</span> <span class="hljs-comment"># used by `highlight` filter: `highlightjs` (default) or `tempest`</span></code></pre>
<p>See the <a href="/templates/reference/filters/#highlight"><code translate="no">highlight</code></a> filter.</p>
<aside class="note note-info"><p>This option only applies to templates: Markdown content uses the <a href="/documentation/pages/#pages-body-highlight"><code translate="no">pages.body.highlight.engine</code></a> option.</p></aside>
<h2 id="layouts-translations">layouts.translations<a class="heading-anchor" href="#layouts-translations" aria-hidden="true" tabindex="-1"></a></h2>
<p>Translations handling options.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">translations:</span>
    <span class="hljs-attr">dir:</span> <span class="hljs-string">translations</span> <span class="hljs-comment"># translations source directory (`translations` by default)</span>
    <span class="hljs-attr">formats:</span>          <span class="hljs-comment"># translations supported formats</span>
      <span class="hljs-attr">yaml:</span>
        <span class="hljs-attr">loader:</span> <span class="hljs-string">Symfony\Component\Translation\Loader\YamlFileLoader</span>
        <span class="hljs-attr">ext:</span> <span class="hljs-string">[yml,</span> <span class="hljs-string">yaml]</span>
      <span class="hljs-attr">mo:</span>
        <span class="hljs-attr">loader:</span> <span class="hljs-string">Symfony\Component\Translation\Loader\MoFileLoader</span>
        <span class="hljs-attr">ext:</span> <span class="hljs-string">[mo]</span></code></pre>
<p>Each translation format defines:</p>
<ul>
<li><code translate="no">loader</code>: Symfony translation loader class</li>
<li><code translate="no">ext</code>: one or more file extensions associated with this format</li>
</ul>
<h2 id="layouts-extensions">layouts.extensions<a class="heading-anchor" href="#layouts-extensions" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="/developers/extend/#twig-extension">Twig extensions</a> to load, indexed by name (empty by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">extensions:</span>
    <span class="hljs-string">&lt;name&gt;:</span> <span class="hljs-string">&lt;class&gt;</span></code></pre>
<p>See <a href="/developers/extend/#configuration">Extensions</a> for the full syntax.</p>
<h2 id="layouts-components">layouts.components<a class="heading-anchor" href="#layouts-components" aria-hidden="true" tabindex="-1"></a></h2>
<p><a href="/templates/components/">Templates Components</a> options.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">components:</span>
    <span class="hljs-attr">dir:</span> <span class="hljs-string">components</span> <span class="hljs-comment"># components source directory (`components` by default)</span>
    <span class="hljs-attr">ext:</span> <span class="hljs-string">twig</span>       <span class="hljs-comment"># components files extension (`twig` by default)</span></code></pre>
<h2 id="layouts-sections">layouts.sections<a class="heading-anchor" href="#layouts-sections" aria-hidden="true" tabindex="-1"></a></h2>
<p>Maps a section to the layouts of another section: the mapped name is used in place of <code translate="no">&lt;section&gt;</code> by the <a href="/templates/lookup-rules/#lookup-rules">lookup rules</a> of the section and of its pages.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">layouts:</span>
  <span class="hljs-attr">sections:</span>
    <span class="hljs-attr">news:</span> <span class="hljs-string">blog</span> <span class="hljs-comment"># the "news" section is rendered with `blog/list.html.twig` and its pages with `blog/page.html.twig`</span></code></pre>
<aside class="note note-tip"><p>A <a href="/content/pages/#sub-section">sub-section</a> already falls back to the layouts of its parent sections: no mapping is needed for that.</p></aside>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/templates/extend/</id>
    <title>Extend templates</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-15T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/templates/extend/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Extend templates</h1>
<p>Templates can be extended with custom functions and filters, or packaged as a reusable theme.</p>
<h2 id="functions-and-filters">Functions and filters<a class="heading-anchor" href="#functions-and-filters" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can add custom <a href="/documentation/reference/functions/">functions</a> and custom <a href="/documentation/reference/filters/">filters</a> with a <a href="/developers/extend/#twig-extension"><strong><em>Twig extension</em></strong></a>.</p>
<h2 id="theme">Theme<a class="heading-anchor" href="#theme" aria-hidden="true" tabindex="-1"></a></h2>
<p>It’s easy to build a theme: create a folder <code translate="no">&lt;theme&gt;</code> with the following structure (like a website but without pages):</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">&lt;my-site&gt;
└─ themes
   └─ &lt;theme&gt;
      ├─ config.yml
      ├─ assets
      ├─ layouts
      ├─ schemas
      ├─ static
      └─ translations</code></pre>
<p>Then enable it with the <a href="/configuration/site/#theme"><code translate="no">theme</code></a> configuration option.</p>
<p>The theme <code translate="no">config.yml</code> overrides the <a href="/configuration/#priority">default configuration</a> and is merged with the site configuration, which takes precedence, except for <a href="/configuration/#lists">lists of values</a>: the site values are added to the theme ones, and a theme value can only be removed with <code translate="no">false</code> (e.g. <code translate="no">homepage: {atom: false}</code>).</p>
<p>The <code translate="no">schemas</code> directory of the theme holds the <a href="/configuration/pages/#schemas-directory">front matter schemas</a> of the variables its templates expect: the schemas of the site override them variable by variable.</p>
<h3 id="required-themes">Required themes<a class="heading-anchor" href="#required-themes" aria-hidden="true" tabindex="-1"></a></h3>
<p>A theme can require other themes (e.g. a component theme providing a search box, or a <a href="/developers/extend/#plugins">plugin</a>) with the <code translate="no">theme</code> option of its <code translate="no">config.yml</code>:</p>
<p><em>/themes/&lt;theme&gt;/config.yml</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">theme:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;required-theme&gt;</span></code></pre>
<p>Required themes are enabled with the theme, with no other configuration of the site: their layouts, assets, static files, translations, extensions and <code translate="no">config.yml</code> are loaded. They are added after the themes of the site, so the theme (like the site) overrides the themes it requires.</p>
<aside class="note note-important"><p>Required themes must be installed too, in the <code translate="no">themes</code> directory of the site: declare them as dependencies in the <code translate="no">composer.json</code> of the theme.</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/output/</id>
    <title>Output</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-26T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/output/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Output</h1>
<p>Defines where and in what format pages are rendered.</p>
<h2 id="output-dir">output.dir<a class="heading-anchor" href="#output-dir" aria-hidden="true" tabindex="-1"></a></h2>
<p>Directory where rendered pages’ files are saved (<code translate="no">_site</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">_site</span></code></pre>
<h2 id="output-formats">output.formats<a class="heading-anchor" href="#output-formats" aria-hidden="true" tabindex="-1"></a></h2>
<p>List of output formats definition, which are used to render pages (e.g. HTML, Atom, RSS, JSON, XML, etc.).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">formats:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">&lt;name&gt;</span>            <span class="hljs-comment"># name of the format, e.g.: `html` (required)</span>
      <span class="hljs-attr">mediatype:</span> <span class="hljs-string">&lt;media</span> <span class="hljs-string">type&gt;</span> <span class="hljs-comment"># media type (MIME type), e.g.: `text/html` (required)</span>
      <span class="hljs-attr">rel:</span> <span class="hljs-string">&lt;rel&gt;</span>              <span class="hljs-comment"># `rel` attribute of the page alternate link, e.g.: `canonical` (optional, `alternate` by default)</span>
      <span class="hljs-attr">subpath:</span> <span class="hljs-string">&lt;sub</span> <span class="hljs-string">path&gt;</span>     <span class="hljs-comment"># sub path, e.g.: `amp` in `path/amp/index.html` (optional)</span>
      <span class="hljs-attr">filename:</span> <span class="hljs-string">&lt;file</span> <span class="hljs-string">name&gt;</span>   <span class="hljs-comment"># file name, e.g.: `index` in `path/index.html` (optional)</span>
      <span class="hljs-attr">extension:</span> <span class="hljs-string">&lt;extension&gt;</span>  <span class="hljs-comment"># file extension, e.g.: `html` in `path/index.html` (required)</span>
      <span class="hljs-attr">exclude:</span> <span class="hljs-string">[&lt;variable&gt;]</span>   <span class="hljs-comment"># don’t apply this format to pages identified by listed variables, e.g.: `[redirect, paginated]` (optional)</span></code></pre>
<p>Those formats are used in the <a href="#output-pagetypeformats"><code translate="no">output.pagetypeformats</code></a> configuration and in the <a href="/content/front-matter/#output"><code translate="no">output</code> page variable</a>.</p>
<h3 id="default-formats">Default formats<a class="heading-anchor" href="#default-formats" aria-hidden="true" tabindex="-1"></a></h3>
<p>Cecil provides some <a href="https://github.com/Cecilapp/Cecil/blob/main/config/default.php#L287-L394" target="_blank" rel="noopener noreferrer">default formats</a>, which can be overridden in the configuration file: <code translate="no">html</code> (default), <code translate="no">atom</code>, <code translate="no">rss</code>, <code translate="no">json</code>, <code translate="no">xml</code>, <code translate="no">txt</code>, <code translate="no">amp</code>, <code translate="no">js</code>, <code translate="no">webmanifest</code>, <code translate="no">xsl</code>, <code translate="no">jsonfeed</code>, <code translate="no">oembed</code>, <code translate="no">embed</code>, <code translate="no">markdown</code>, <code translate="no">llms</code>.</p>
<p>Formats are merged by <code translate="no">name</code>: to override a default format, only define its <code translate="no">name</code> and the properties to change.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">formats:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">rss</span>
      <span class="hljs-attr">filename:</span> <span class="hljs-string">feed</span> <span class="hljs-comment"># `feed.xml` instead of `rss.xml`</span></code></pre>
<h2 id="output-pagetypeformats">output.pagetypeformats<a class="heading-anchor" href="#output-pagetypeformats" aria-hidden="true" tabindex="-1"></a></h2>
<p>It’s not required to set <code translate="no">output</code> variable for each page, as Cecil automatically applies the formats defined for each page type (<code translate="no">homepage</code>, <code translate="no">page</code>, <code translate="no">section</code>, <code translate="no">vocabulary</code> and <code translate="no">term</code>).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">pagetypeformats:</span>
    <span class="hljs-attr">page:</span> <span class="hljs-string">[&lt;format&gt;]</span>
    <span class="hljs-attr">homepage:</span> <span class="hljs-string">[&lt;format&gt;]</span>
    <span class="hljs-attr">section:</span> <span class="hljs-string">[&lt;format&gt;]</span>
    <span class="hljs-attr">vocabulary:</span> <span class="hljs-string">[&lt;format&gt;]</span>
    <span class="hljs-attr">term:</span> <span class="hljs-string">[&lt;format&gt;]</span></code></pre>
<p>Several formats can be defined for a single page type. For example, the <code translate="no">section</code> page type can be automatically rendered in HTML and Atom:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">pagetypeformats:</span>
    <span class="hljs-attr">section:</span> <span class="hljs-string">[html,</span> <span class="hljs-string">atom]</span></code></pre>
<p>A list replaces the default formats of the page type (and is added to the formats defined by the theme). To add or remove a format instead, use a <a href="/documentation/#lists">map of booleans</a>:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">pagetypeformats:</span>
    <span class="hljs-attr">homepage:</span>
      <span class="hljs-attr">rss:</span> <span class="hljs-literal">true</span>   <span class="hljs-comment"># adds RSS</span>
      <span class="hljs-attr">atom:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># removes Atom</span></code></pre>
<aside class="note note-info"><p>To render a page, <a href="/templates/lookup-rules/#lookup-rules">Cecil looks up a template</a> named <code translate="no">&lt;layout&gt;.&lt;format&gt;.twig</code> (e.g. <code translate="no">page.html.twig</code>).</p></aside>
<h2 id="output-example">output example<a class="heading-anchor" href="#output-example" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">_site</span>
  <span class="hljs-attr">formats:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">html</span>
      <span class="hljs-attr">mediatype:</span> <span class="hljs-string">text/html</span>
      <span class="hljs-attr">filename:</span> <span class="hljs-string">index</span>
      <span class="hljs-attr">extension:</span> <span class="hljs-string">html</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">atom</span>
      <span class="hljs-attr">mediatype:</span> <span class="hljs-string">application/atom+xml</span>
      <span class="hljs-attr">filename:</span> <span class="hljs-string">atom</span>
      <span class="hljs-attr">extension:</span> <span class="hljs-string">xml</span>
      <span class="hljs-attr">exclude:</span> <span class="hljs-string">[redirect,</span> <span class="hljs-string">paginated]</span>
  <span class="hljs-attr">pagetypeformats:</span>
    <span class="hljs-attr">page:</span> <span class="hljs-string">[html]</span>
    <span class="hljs-attr">homepage:</span> <span class="hljs-string">[html,</span> <span class="hljs-string">atom]</span>
    <span class="hljs-attr">section:</span> <span class="hljs-string">[html,</span> <span class="hljs-string">atom]</span>
    <span class="hljs-attr">vocabulary:</span> <span class="hljs-string">[html]</span>
    <span class="hljs-attr">term:</span> <span class="hljs-string">[html,</span> <span class="hljs-string">atom]</span></code></pre>
<h2 id="output-postprocessors">output.postprocessors<a class="heading-anchor" href="#output-postprocessors" aria-hidden="true" tabindex="-1"></a></h2>
<p>Output post processors, indexed by name and run in ascending order of their priority, used to modify the output files after they have been generated.</p>
<p>Default post processors:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">output:</span>
  <span class="hljs-attr">postprocessors:</span>
    <span class="hljs-attr">GeneratorMetaTag:</span> <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Renderer\PostProcessor\GeneratorMetaTag,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">10</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">HtmlExcerpt:</span>      <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Renderer\PostProcessor\HtmlExcerpt,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">20</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">MarkdownLink:</span>     <span class="hljs-string">{</span> <span class="hljs-attr">class:</span> <span class="hljs-string">Cecil\Renderer\PostProcessor\MarkdownLink,</span> <span class="hljs-attr">priority:</span> <span class="hljs-number">30</span> <span class="hljs-string">}</span></code></pre>
<p>A post processor can be disabled by its name (e.g.: <code translate="no">GeneratorMetaTag: false</code>). See <a href="/developers/extend/#configuration">Extensions</a> for the full syntax.</p>
<aside class="note note-tip"><p>You can extend Cecil capabilities with an <a href="/developers/extend/#output-post-processors">Output post processor</a>.</p></aside>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/cache/</id>
    <title>Cache</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/cache/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Cache</h1>
<p>Cache options.</p>
<h2 id="cache-enabled">cache.enabled<a class="heading-anchor" href="#cache-enabled" aria-hidden="true" tabindex="-1"></a></h2>
<p>Cache is enabled by default (<code translate="no">true</code>), but you can disable it with:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">cache:</span>
  <span class="hljs-attr">enabled:</span> <span class="hljs-literal">false</span></code></pre>
<p>Or with the shorthand:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">cache:</span> <span class="hljs-literal">false</span></code></pre>
<aside class="note note-warning"><p>It’s not recommended to disable the cache for performance reasons.</p></aside>
<h2 id="cache-dir">cache.dir<a class="heading-anchor" href="#cache-dir" aria-hidden="true" tabindex="-1"></a></h2>
<p>Directory where cache files are stored (<code translate="no">.cache</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">cache:</span>
  <span class="hljs-attr">dir:</span> <span class="hljs-string">'.cache'</span></code></pre>
<aside class="note note-info"><p>The cache directory is relative to the site directory, but you can use an absolute path: it can be useful to store the cache in a shared directory.</p></aside>
<h2 id="cache-assets">cache.assets<a class="heading-anchor" href="#cache-assets" aria-hidden="true" tabindex="-1"></a></h2>
<p>Assets cache options.</p>
<h3 id="cache-assets-ttl">cache.assets.ttl<a class="heading-anchor" href="#cache-assets-ttl" aria-hidden="true" tabindex="-1"></a></h3>
<p>Time to live of assets cache in seconds (<code translate="no">null</code> by default = no expiration).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">cache:</span>
  <span class="hljs-attr">assets:</span>
    <span class="hljs-attr">ttl:</span> <span class="hljs-string">~</span></code></pre>
<h3 id="cache-assets-remote-ttl">cache.assets.remote.ttl<a class="heading-anchor" href="#cache-assets-remote-ttl" aria-hidden="true" tabindex="-1"></a></h3>
<p>Time to live of remote assets cache in seconds (7 days by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">cache:</span>
  <span class="hljs-attr">assets:</span>
    <span class="hljs-attr">remote:</span>
      <span class="hljs-attr">ttl:</span> <span class="hljs-number">604800</span> <span class="hljs-comment"># 7 days</span></code></pre>
<h2 id="cache-templates">cache.templates<a class="heading-anchor" href="#cache-templates" aria-hidden="true" tabindex="-1"></a></h2>
<p>Disables templates cache with <code translate="no">false</code> (<code translate="no">true</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">cache:</span>
  <span class="hljs-attr">templates:</span> <span class="hljs-literal">true</span></code></pre>
<aside class="note note-info"><p>See <a href="/templates/cache/">templates cache documentation</a> for more details.</p></aside>
<h2 id="cache-translations">cache.translations<a class="heading-anchor" href="#cache-translations" aria-hidden="true" tabindex="-1"></a></h2>
<p>Disables translations cache with <code translate="no">false</code> (<code translate="no">true</code> by default).</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">cache:</span>
  <span class="hljs-attr">translations:</span> <span class="hljs-literal">true</span></code></pre>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/server/</id>
    <title>Server and optimization</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/server/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Server and optimization</h1>
<p>These options configure the local preview server and the optimization of the generated files.</p>
<h2 id="server">Server<a class="heading-anchor" href="#server" aria-hidden="true" tabindex="-1"></a></h2>
<h3 id="server-headers">server.headers<a class="heading-anchor" href="#server-headers" aria-hidden="true" tabindex="-1"></a></h3>
<p>You can define custom <a href="https://developer.mozilla.org/docs/Glossary/Response_header" target="_blank" rel="noopener noreferrer">HTTP headers</a>, used by the local preview server.</p>
<aside class="note note-warning"><p>Since version <ins>8.38.0</ins>, the <code translate="no">headers</code> option has been moved to the <code translate="no">server.headers</code> section.</p></aside>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">server:</span>
  <span class="hljs-attr">headers:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">&lt;path&gt;</span> <span class="hljs-comment"># Relative path, prefixed with a slash. Supports the `*` wildcard.</span>
      <span class="hljs-attr">headers:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">&lt;key&gt;</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"&lt;value&gt;"</span></code></pre>
<aside class="note note-tip"><p>It’s useful to test custom <a href="https://developer.mozilla.org/docs/Web/HTTP/CSP" target="_blank" rel="noopener noreferrer">Content Security Policy</a> or <a href="https://developer.mozilla.org/docs/Web/HTTP/Headers/Cache-Control" target="_blank" rel="noopener noreferrer">Cache-Control</a>.</p></aside>
<p><em>Example:</em></p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">server:</span>
  <span class="hljs-attr">headers:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">/*</span>
      <span class="hljs-attr">headers:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">X-Frame-Options</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"SAMEORIGIN"</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">X-XSS-Protection</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"1; mode=block"</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">X-Content-Type-Options</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"nosniff"</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">Content-Security-Policy</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"default-src 'self'; object-src 'self'; img-src 'self'"</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">Strict-Transport-Security</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"max-age=31536000; includeSubDomains; preload"</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">/assets/*</span>
      <span class="hljs-attr">headers:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">Cache-Control</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"public, max-age=31536000"</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">/foo.html</span>
      <span class="hljs-attr">headers:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">key:</span> <span class="hljs-string">Foo</span>
          <span class="hljs-attr">value:</span> <span class="hljs-string">"bar"</span></code></pre>
<hr>
<h2 id="optimize">Optimize<a class="heading-anchor" href="#optimize" aria-hidden="true" tabindex="-1"></a></h2>
<p>The optimization options enable compression of output files: HTML, CSS, JavaScript and images.</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">optimize:</span>
  <span class="hljs-attr">enabled:</span> <span class="hljs-literal">false</span>     <span class="hljs-comment"># enables files optimization (`false` by default)</span>
  <span class="hljs-attr">html:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># enables HTML files optimization</span>
    <span class="hljs-attr">ext:</span> <span class="hljs-string">[html,</span> <span class="hljs-string">htm]</span>   <span class="hljs-comment"># supported files extensions</span>
  <span class="hljs-attr">css:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># enables CSS files optimization</span>
    <span class="hljs-attr">ext:</span> <span class="hljs-string">[css]</span>         <span class="hljs-comment"># supported files extensions</span>
  <span class="hljs-attr">js:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># enables JavaScript files optimization</span>
    <span class="hljs-attr">ext:</span> <span class="hljs-string">[js]</span>          <span class="hljs-comment"># supported files extensions</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># enables images files optimization</span>
    <span class="hljs-attr">ext:</span> <span class="hljs-string">[jpeg,</span> <span class="hljs-string">jpg,</span> <span class="hljs-string">png,</span> <span class="hljs-string">gif,</span> <span class="hljs-string">webp,</span> <span class="hljs-string">svg,</span> <span class="hljs-string">avif]</span> <span class="hljs-comment"># supported files extensions</span></code></pre>
<p>This option is disabled by default and can be enabled via:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">optimize:</span> <span class="hljs-literal">true</span></code></pre>
<p>Once the global option is enabled, the 4 file types will be processed.<br>
It is possible to disable each of them via <code translate="no">enabled: false</code> and change the processed file extensions via <code translate="no">ext</code>.</p>
<aside class="note note-tip"><p>It is also possible to enable (or disable) this option through CLI when using the <code translate="no">build</code> and <code translate="no">serve</code> commands, with the <code translate="no">--optimize</code> (or <code translate="no">--no-optimize</code>) option.</p></aside>
<aside class="note note-important"><p><strong>Images</strong> compressor will use these binaries if they are present in the system: <a href="https://github.com/tjko/jpegoptim" target="_blank" rel="noopener noreferrer">JpegOptim</a>, <a href="http://optipng.sourceforge.net/" target="_blank" rel="noopener noreferrer">Optipng</a>, <a href="https://pngquant.org/" target="_blank" rel="noopener noreferrer">Pngquant 2</a>, <a href="https://github.com/svg/svgo" target="_blank" rel="noopener noreferrer">SVGO</a>, <a href="http://www.lcdf.org/gifsicle/" target="_blank" rel="noopener noreferrer">Gifsicle</a>, <a href="https://developers.google.com/speed/webp/docs/cwebp" target="_blank" rel="noopener noreferrer">cwebp</a> and <a href="https://github.com/AOMediaCodec/libavif" target="_blank" rel="noopener noreferrer">avifenc</a>.</p></aside>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/override/</id>
    <title>Override configuration</title>
    <published>2021-05-07T00:00:00+00:00</published>
    <updated>2026-11-04T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/override/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Override configuration</h1>
<p>The configuration can be overridden without editing the configuration file, through environment variables or a CLI option.</p>
<h2 id="environment-variables">Environment variables<a class="heading-anchor" href="#environment-variables" aria-hidden="true" tabindex="-1"></a></h2>
<p>The configuration can be overridden through <a href="https://en.wikipedia.org/wiki/Environment_variable" target="_blank" rel="noopener noreferrer">environment variables</a>.</p>
<p>At startup, Cecil also attempts to load a <code translate="no">.env</code> file from the current site path (the current working directory, or the <code translate="no">&lt;path&gt;</code> argument if provided).</p>
<ul>
<li>If the <code translate="no">.env</code> file does not exist, Cecil continues normally.</li>
<li>Variables already defined by the shell/system are preserved.</li>
</ul>
<p>Each environment variable name must be prefixed with <code translate="no">CECIL_</code> and the configuration key must be set in uppercase. Nested keys are separated with <code translate="no">_</code> (e.g.: <code translate="no">CECIL_PAGES_DIR</code> sets <code translate="no">pages.dir</code>), so keys that contain an underscore can't be set this way. Boolean-like values (<code translate="no">true</code>/<code translate="no">false</code>, <code translate="no">1</code>/<code translate="no">0</code>, <code translate="no">yes</code>/<code translate="no">no</code>, <code translate="no">on</code>/<code translate="no">off</code>) are converted to booleans, and numeric values are converted to numbers when the option expects a number (e.g.: <code translate="no">CECIL_ASSETS_IMAGES_QUALITY=80</code>).</p>
<p>For example, the following command sets the website’s <code translate="no">baseurl</code>:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no"><span class="hljs-built_in">export</span> CECIL_BASEURL=<span class="hljs-string">"https://example.com/"</span></code></pre>
<p>You can store the same value in a <code translate="no">.env</code> file at your project root:</p>
<pre data-lang="dotenv"><code class="language-dotenv" translate="no">CECIL_BASEURL="https://example.com/"
CECIL_TITLE="My Cecil site"</code></pre>
<h2 id="cli-option">CLI option<a class="heading-anchor" href="#cli-option" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can combine multiple configuration files with the <code translate="no">--config</code> option of the <code translate="no">build</code> and <code translate="no">serve</code> commands:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar build --config config-1.yml,config-2.yml</code></pre>
<p>The files are merged from left to right, after the main configuration file: a scalar value is replaced by the last one defined, maps are merged key by key, <a href="/documentation/#lists">lists of values</a> are replaced (or adjusted with a map of booleans), output formats are merged by <code translate="no">name</code> and other lists of entries (e.g. menus) are concatenated.</p>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/deploy/continuous-deployment/</id>
    <title>Continuous build &amp; deploy</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/deploy/continuous-deployment/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Continuous build &amp; deploy</h1>
<p>Continuous integration services can build your site with Cecil and deploy it on each change to your repository.</p>
<h2 id="github-pages">GitHub Pages<a class="heading-anchor" href="#github-pages" aria-hidden="true" tabindex="-1"></a></h2>
<blockquote>
<p>Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.</p>
</blockquote>
<p>➡️ <a href="https://pages.github.com" target="_blank" rel="noopener noreferrer">https://pages.github.com</a></p>
<p><em>.github/workflows/build-and-deploy.yml</em>:</p>
<pre data-lang="yml"><code class="language-yml hljs yaml" translate="no"><span class="hljs-attr">name:</span> <span class="hljs-string">Build</span> <span class="hljs-string">and</span> <span class="hljs-string">deploy</span> <span class="hljs-string">to</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">Pages</span>
<span class="hljs-attr">on:</span>
  <span class="hljs-attr">push:</span>
    <span class="hljs-attr">branches:</span> <span class="hljs-string">[master,</span> <span class="hljs-string">main]</span>
  <span class="hljs-attr">workflow_dispatch:</span>
<span class="hljs-attr">concurrency:</span>
  <span class="hljs-attr">group:</span> <span class="hljs-string">pages</span>
  <span class="hljs-attr">cancel-in-progress:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">jobs:</span>
  <span class="hljs-attr">build:</span>
    <span class="hljs-attr">runs-on:</span> <span class="hljs-string">ubuntu-latest</span>
    <span class="hljs-attr">steps:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Checkout</span> <span class="hljs-string">source</span>
        <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/checkout@v7</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Restore</span> <span class="hljs-string">Cecil</span> <span class="hljs-string">cache</span>
        <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/cache/restore@v6</span>
        <span class="hljs-attr">with:</span>
          <span class="hljs-attr">path:</span> <span class="hljs-string">./.cache</span>
          <span class="hljs-attr">key:</span> <span class="hljs-string">cecil-cache-</span>
          <span class="hljs-attr">restore-keys:</span> <span class="hljs-string">|
            cecil-cache-
</span>      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Build</span> <span class="hljs-string">site</span>
        <span class="hljs-attr">uses:</span> <span class="hljs-string">Cecilapp/Cecil-Action@v4</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Save</span> <span class="hljs-string">Cecil</span> <span class="hljs-string">cache</span>
        <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/cache/save@v6</span>
        <span class="hljs-attr">with:</span>
          <span class="hljs-attr">path:</span> <span class="hljs-string">./.cache</span>
          <span class="hljs-attr">key:</span> <span class="hljs-string">cecil-cache-${{</span> <span class="hljs-string">hashFiles('./.cache/**/*')</span> <span class="hljs-string">}}</span>
  <span class="hljs-attr">deploy:</span>
    <span class="hljs-attr">needs:</span> <span class="hljs-string">build</span>
    <span class="hljs-attr">permissions:</span>
      <span class="hljs-attr">pages:</span> <span class="hljs-string">write</span>
      <span class="hljs-attr">id-token:</span> <span class="hljs-string">write</span>
    <span class="hljs-attr">environment:</span>
      <span class="hljs-attr">name:</span> <span class="hljs-string">github-pages</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">${{</span> <span class="hljs-string">steps.deployment.outputs.page_url</span> <span class="hljs-string">}}</span>
    <span class="hljs-attr">runs-on:</span> <span class="hljs-string">ubuntu-latest</span>
    <span class="hljs-attr">steps:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Deploy</span> <span class="hljs-string">to</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">Pages</span>
        <span class="hljs-attr">id:</span> <span class="hljs-string">deployment</span>
        <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/deploy-pages@v5</span></code></pre>
<p><a href="https://docs.github.com/en/pages" target="_blank" rel="noopener noreferrer">Official documentation</a></p>
<h2 id="gitlab-ci">GitLab CI<a class="heading-anchor" href="#gitlab-ci" aria-hidden="true" tabindex="-1"></a></h2>
<blockquote>
<p>With GitLab Pages, you can publish static websites directly from a repository in GitLab.</p>
</blockquote>
<p>➡️ <a href="https://about.gitlab.com/solutions/continuous-integration/" target="_blank" rel="noopener noreferrer">https://about.gitlab.com/solutions/continuous-integration/</a></p>
<p><em>.gitlab-ci.yml</em>:</p>
<pre data-lang="yml"><code class="language-yml hljs yaml" translate="no"><span class="hljs-attr">image:</span> <span class="hljs-string">wordpress:cli-php8.4</span>
<span class="hljs-attr">test:</span>
  <span class="hljs-attr">stage:</span> <span class="hljs-string">test</span>
  <span class="hljs-attr">variables:</span>
    <span class="hljs-attr">CECIL_OUTPUT_DIR:</span> <span class="hljs-string">test</span>
  <span class="hljs-attr">script:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">curl</span> <span class="hljs-string">-sSOL</span> <span class="hljs-string">https://cecil.app/build.sh</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">bash</span> <span class="hljs-string">./build.sh</span>
  <span class="hljs-attr">artifacts:</span>
    <span class="hljs-attr">paths:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">test</span>
  <span class="hljs-attr">rules:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">if:</span> <span class="hljs-string">$CI_COMMIT_BRANCH</span> <span class="hljs-string">!=</span> <span class="hljs-string">$CI_DEFAULT_BRANCH</span>
<span class="hljs-attr">pages:</span>
  <span class="hljs-attr">stage:</span> <span class="hljs-string">deploy</span>
  <span class="hljs-attr">variables:</span>
    <span class="hljs-attr">CECIL_ENV:</span> <span class="hljs-string">production</span>
    <span class="hljs-attr">CECIL_OUTPUT_DIR:</span> <span class="hljs-string">public</span>
  <span class="hljs-attr">script:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">curl</span> <span class="hljs-string">-sSOL</span> <span class="hljs-string">https://cecil.app/build.sh</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">bash</span> <span class="hljs-string">./build.sh</span>
  <span class="hljs-attr">artifacts:</span>
    <span class="hljs-attr">paths:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">public</span>
  <span class="hljs-attr">rules:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">if:</span> <span class="hljs-string">$CI_COMMIT_BRANCH</span> <span class="hljs-string">==</span> <span class="hljs-string">$CI_DEFAULT_BRANCH</span>
<span class="hljs-attr">cache:</span>
  <span class="hljs-attr">paths:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">composer-cache/</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">vendor/</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">.cache/</span></code></pre>
<p><a href="https://docs.gitlab.com/user/project/pages/" target="_blank" rel="noopener noreferrer">Official documentation</a></p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/deploy/jamstack-platforms/</id>
    <title>Jamstack platforms</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-25T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/deploy/jamstack-platforms/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Jamstack platforms</h1>
<p>Jamstack platforms can build and deploy your Cecil site automatically on each push to your Git repository.</p>
<p>The build script deduces the build context (<code translate="no">production</code> or <code translate="no">preview</code>) and the base URL from the platform. A <code translate="no">CECIL_ENV</code> environment variable you define takes precedence over the deduced build context.</p>
<h2 id="netlify">Netlify<a class="heading-anchor" href="#netlify" aria-hidden="true" tabindex="-1"></a></h2>
<blockquote>
<p>A powerful serverless platform with an intuitive git-based workflow. Automated deployments, shareable previews, and much more.</p>
</blockquote>
<p>➡️ <a href="https://www.netlify.com" target="_blank" rel="noopener noreferrer">https://www.netlify.com</a></p>
<p><em>netlify.toml</em>:</p>
<pre data-lang="toml"><code class="language-toml hljs ini" translate="no"><span class="hljs-section">[build]</span>
  publish = "_site"
  command = "curl -sSOL https://cecil.app/build.sh &amp;&amp; bash ./build.sh"
<span class="hljs-section">[context.production.environment]</span>
  CECIL_ENV = "production"
<span class="hljs-section">[context.deploy-preview.environment]</span>
  CECIL_ENV = "preview"</code></pre>
<p><a href="https://docs.netlify.com/build/configure-builds/overview/" target="_blank" rel="noopener noreferrer">Official documentation</a></p>
<h2 id="vercel">Vercel<a class="heading-anchor" href="#vercel" aria-hidden="true" tabindex="-1"></a></h2>
<blockquote>
<p>Vercel combines the best developer experience with an obsessive focus on end-user performance.</p>
</blockquote>
<p>➡️ <a href="https://vercel.com" target="_blank" rel="noopener noreferrer">https://vercel.com</a></p>
<p><em>vercel.json</em>:</p>
<pre data-lang="json"><code class="language-json hljs json" translate="no">{
  <span class="hljs-attr">"buildCommand"</span>: <span class="hljs-string">"curl -sSOL https://cecil.app/build.sh &amp;&amp; bash ./build.sh"</span>,
  <span class="hljs-attr">"outputDirectory"</span>: <span class="hljs-string">"_site"</span>
}</code></pre>
<p><a href="https://vercel.com/docs/builds/configure-a-build" target="_blank" rel="noopener noreferrer">Official documentation</a></p>
<h2 id="statichost">statichost<a class="heading-anchor" href="#statichost" aria-hidden="true" tabindex="-1"></a></h2>
<blockquote>
<p>Modern static site hosting with European servers and absolutely no personal data collection!</p>
</blockquote>
<p>➡️ <a href="https://statichost.eu" target="_blank" rel="noopener noreferrer">https://statichost.eu</a></p>
<p><em>statichost.yml</em>:</p>
<pre data-lang="yml"><code class="language-yml hljs yaml" translate="no"><span class="hljs-attr">image:</span> <span class="hljs-string">wordpress:cli-php8.4</span>
<span class="hljs-attr">command:</span> <span class="hljs-string">curl</span> <span class="hljs-string">-sSOL</span> <span class="hljs-string">https://cecil.app/build.sh</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">bash</span> <span class="hljs-string">./build.sh</span>
<span class="hljs-attr">public:</span> <span class="hljs-string">_site</span></code></pre>
<p><a href="https://www.statichost.eu/docs/" target="_blank" rel="noopener noreferrer">Official documentation</a></p>
<h2 id="cloudflare-pages">Cloudflare Pages<a class="heading-anchor" href="#cloudflare-pages" aria-hidden="true" tabindex="-1"></a></h2>
<aside class="note note-info"><p>Cloudflare Pages doesn’t provide PHP: the build script uses the Cecil <a href="/getting-started/installation/#standalone-binary">standalone binary</a> instead, and installs themes from <code translate="no">composer.lock</code>.</p>
<p>In production (<code translate="no">main</code> or <code translate="no">master</code> branch), the <code translate="no">baseurl</code> of the site configuration is used: preview deployments use their own URL.</p></aside>
<blockquote>
<p>Cloudflare Pages is a Jamstack platform for frontend developers to collaborate and deploy websites.</p>
</blockquote>
<p>➡️ <a href="https://www.cloudflare.com/products/pages/" target="_blank" rel="noopener noreferrer">https://www.cloudflare.com/products/pages/</a></p>
<p>Build configurations:</p>
<ul>
<li>Framework preset: <code translate="no">None</code></li>
<li>Build command: <code translate="no">curl -sSOL https://cecil.app/build.sh &amp;&amp; bash ./build.sh</code></li>
<li>Build output directory: <code translate="no">_site</code></li>
</ul>
<p><a href="https://developers.cloudflare.com/pages/" target="_blank" rel="noopener noreferrer">Official documentation</a></p>
<h2 id="render">Render<a class="heading-anchor" href="#render" aria-hidden="true" tabindex="-1"></a></h2>
<aside class="note note-info"><p>Render only provides PHP 7.3: the build script uses the Cecil <a href="/getting-started/installation/#standalone-binary">standalone binary</a> instead, and installs themes from <code translate="no">composer.lock</code>.</p>
<p>In production, the <code translate="no">baseurl</code> of the site configuration is used: pull request previews use their own URL.</p></aside>
<blockquote>
<p>Render is a unified cloud to build and run all your apps and websites with free TLS certificates, global CDN, private networks and auto deploys from Git.</p>
</blockquote>
<p>➡️ <a href="https://render.com" target="_blank" rel="noopener noreferrer">https://render.com</a></p>
<p><em>render.yaml</em>:</p>
<pre data-lang="yml"><code class="language-yml hljs yaml" translate="no"><span class="hljs-attr">services:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">type:</span> <span class="hljs-string">web</span>
    <span class="hljs-attr">runtime:</span> <span class="hljs-string">static</span>
    <span class="hljs-attr">name:</span> <span class="hljs-string">Cecil</span>
    <span class="hljs-attr">buildCommand:</span> <span class="hljs-string">curl</span> <span class="hljs-string">-sSOL</span> <span class="hljs-string">https://cecil.app/build.sh</span> <span class="hljs-string">&amp;&amp;</span> <span class="hljs-string">bash</span> <span class="hljs-string">./build.sh</span>
    <span class="hljs-attr">staticPublishPath:</span> <span class="hljs-string">./_site</span>
    <span class="hljs-attr">autoDeployTrigger:</span> <span class="hljs-string">commit</span>
    <span class="hljs-attr">previews:</span>
      <span class="hljs-attr">generation:</span> <span class="hljs-string">automatic</span></code></pre>
<p><a href="https://render.com/docs/static-sites" target="_blank" rel="noopener noreferrer">Official documentation</a></p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/deploy/static-hosting/</id>
    <title>Static hosting</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-29T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/deploy/static-hosting/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Static hosting</h1>
<p>The built site can be uploaded as is to any static hosting service.</p>
<h2 id="surge">Surge<a class="heading-anchor" href="#surge" aria-hidden="true" tabindex="-1"></a></h2>
<blockquote>
<p>Shipping web projects should be fast, easy, and low risk. Surge is static web publishing for Front-End Developers, right from the CLI.</p>
</blockquote>
<p>➡️ <a href="https://surge.sh" target="_blank" rel="noopener noreferrer">https://surge.sh</a></p>
<p>Terminal:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">npm install -g surge
surge _site/</code></pre>
<p><a href="https://surge.sh/help/" target="_blank" rel="noopener noreferrer">Official documentation</a></p>
<h2 id="deed-page">deed.page<a class="heading-anchor" href="#deed-page" aria-hidden="true" tabindex="-1"></a></h2>
<blockquote>
<p>Static hosting with no account: upload the built site in one request and get a permanent <code translate="no">https://&lt;slug&gt;.deed.page/</code> URL.</p>
</blockquote>
<p>➡️ <a href="https://deed.page" target="_blank" rel="noopener noreferrer">https://deed.page</a></p>
<p>Terminal:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">cecil build --baseurl=https://my-cecil-site.deed.page/
tar -C _site -czf site.tar.gz .
curl -T site.tar.gz <span class="hljs-string">"https://deed.page/v1/sites?slug=my-cecil-site"</span></code></pre>
<p>Replace <code translate="no">my-cecil-site</code> with a unique slug of your choice.<br>
The JSON response includes a token that is shown only once: keep it private, and send it as an <code translate="no">Authorization: Bearer</code> header to update the same slug later. A single request is limited to 4 MB (larger sites can use a manifest upload).</p>
<p><a href="https://deed.page/docs" target="_blank" rel="noopener noreferrer">Official documentation</a></p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/commands/new-site/</id>
    <title>new:site</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-11-01T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/commands/new-site/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>new:site</h1>
<p>Creates a new site.</p>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Creates a new website

Usage:
  new:site [options] [--] [&lt;path&gt;]

Arguments:
  path                  Use the given path as working directory

Options:
  -f, --force           Override directory if it already exists
      --demo            Add demo content (pages, templates and assets)
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The new:site command creates a new website in the current directory, or in &lt;path&gt; if provided.
  If you run this command without any options, it will ask you for the website title, baseline, base URL, description, author, language, etc.

    cecil.phar new:site
    cecil.phar new:site path/to/the/working/directory

  To create a new website with demo content, run:

    cecil.phar new:site --demo

  To override an existing website, run:

    cecil.phar new:site --force</code></pre>
<h2 id="created-files">Created files<a class="heading-anchor" href="#created-files" aria-hidden="true" tabindex="-1"></a></h2>
<p>The command creates the following files:</p>
<ul>
<li><code translate="no">cecil.yml</code>: the configuration, with commented examples of common options</li>
<li><code translate="no">pages/index.md</code>: the home page</li>
<li><code translate="no">assets/favicon.png</code> and <code translate="no">assets/icon.png</code>: the favicon and the default image of social networks cards</li>
<li><code translate="no">static/favicon.ico</code>: the legacy favicon</li>
<li><code translate="no">README.md</code> and <code translate="no">.gitignore</code> (<code translate="no">_site/</code>, <code translate="no">.cache/</code> and <code translate="no">.cecil/</code>), if they don't already exist</li>
<li><code translate="no">.github/workflows/build-and-deploy.yml</code>: a GitHub Actions workflow to <a href="https://cecil.app/how-to/deploy-github-pages/">deploy on GitHub Pages</a>, if requested</li>
</ul>
<p>With the <code translate="no">--demo</code> option, it also adds demo content: a blog (with tags, pagination, a draft and a French translation), a documentation section (sorted by weight, with a table of contents enabled by <code translate="no">cascade</code>), custom templates, a Sass stylesheet, a data file and translations.</p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/getting-started/quick-start/</id>
    <title>Quick start</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-11-01T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/getting-started/quick-start/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Quick start</h1>
<p>This guide walks you through creating your first Cecil website, previewing it locally, then building and deploying it.</p>
<h2 id="create-a-website">Create a website<a class="heading-anchor" href="#create-a-website" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can create a new website from scratch in a few minutes.</p>
<p>Follow the steps below to create your first Cecil website.</p>
<p><a href="https://cecilapp.github.io/skeleton/" target="_blank" rel="noopener noreferrer"><picture>
<source media="(prefers-color-scheme: dark)" type="image/avif" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.avif 480w, https://cecil.app/thumbnails/768x/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.avif 768w, https://cecil.app/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.avif 1007w" sizes="100vw">
<source media="(prefers-color-scheme: dark)" type="image/webp" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.webp 480w, https://cecil.app/thumbnails/768x/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.webp 768w, https://cecil.app/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.webp 1007w" sizes="100vw">
<source media="(prefers-color-scheme: dark)" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.png 480w, https://cecil.app/thumbnails/768x/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.png 768w, https://cecil.app/docs/cecil-newsite.dark.19f0a851a99b34775f44b67c805a0815.png 1007w" sizes="100vw">
<source type="image/avif" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.avif 480w, https://cecil.app/thumbnails/768x/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.avif 768w, https://cecil.app/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.avif 1007w" width="1007" height="607" sizes="100vw">
<source type="image/webp" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.webp 480w, https://cecil.app/thumbnails/768x/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.webp 768w, https://cecil.app/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.webp 1007w" width="1007" height="607" sizes="100vw">
<img src="https://cecil.app/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.png" alt="New website example" loading="lazy" decoding="async" class="dark:brightness-90" width="1007" height="607" style=";max-width:100%;height:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAA8CAYAAACQPx/OAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAHB0lEQVR4nOVc6RrbKAyU+Pz+b9d9nGp/gEAXl4/E2Z02NSYYZA0jYZIG//z5hwAAiAj0ESCunx3hUSDyEQFFxdmytJf7jsYrV4g69GUAIAg6AQAA75jIV0fn6rADNoAoO4SI3PFJ8M0j5vHzGVwiBVPPgXbcerWyxZVNuwxyddmHfqwBId6o7G+ESlYptvfuh1SEPXYdzcS1N5YIWrHDOtaRURqe9ccCITYUtZEQtI7Y6Cvk1BtnhxdF2GOokKBdKQF0HHeVEDmubNdC/rRrhaOFIH2MQW2gTkw8S4ZyMmKoCHuckyFVYs8/QQjVqLIazo98gxzj5NE6l0SJyqlsd44JxPwPE6JeHXXMj1IVfA7G8XcTIsoEQMWeRgyHMqrtwqSOxpgeCbZOknJWno6EhJAw1fI+Ibbsicl1EJIzs7XX1vEphtRK0cSESd0Ssro8K93n2XBCHIqMQkRKCJhSIwW94/NfFDcdqyJWiLKgU272DazvtDWOCJXCR60YhldI0O8oHO1yYUNUwpQJSSm/ynkUtiQZmggQiwD9XjnrqESdbcOTxgmk+GWoFD62FAEQEOJnUkM3MS3eT5QnWBkppaaOGrpy5yg8HxOCYH0+VohOwHuYXUTOllgpBC3Zt6TfJWQ48ysxuHxTYdLGQgSWUKUUkupKCrUUjGJa/9UmNW4vHKE5vwtGJc3UsorNqshH62XqE3KnjT0yJCn8Qs4lImTppW02UCVZSYwat6f+KwpZBNskiIkeLXKZV6vIhLQ4tkYIAiABriaQASEJW7iqqyuV1CPnaZVIu8u7cmhVQF17++RzEOqIoPfSWCEIJcgRIBBAIkh/Cf4CAdgXUgmTNIlrxqiBQhATJA5bYuWFKn+gcbq5Y9CObUQ4CuxlH4FeNseOKwpJfFqbAwBAAkgE8FfxgYBihbBDCAwUwqTkycEhqpXtQqO6WNZ1ckhtH6hHtfkAO/zs0fYErQ02hyA6ZSSg/Af9km0L2Gb8TC2Kl3ItlHsIVTCY65W8uuXjzPoKonFFDhFYUMY+IZx4y4w3ISyJcpvOCBTMZ7mR3VYxpMixbXSNsCmy9AGCxvtYcrVHcLRZp+feSBknd62Kr8VStiZtuUbK9d6pA5Bso/afXc1HVlgbkHZkhbDRdZaJDMmJnjIN9Xhu6GKAPzJRkZd4hhNAXdUpB4vcsKaMVTs3Lwuw94EdNoWUUygPjX2J45kbdMOWgiCC+z+DShLV9QuGyqjDvhI52SMcdhGWhYE1BrSbhDCmV+wsgXUBVsmYReJm59DSRZxXytmPshEBDmDnt+6EOYUE1KHDNAV1wWxQHlnWoGuxjUZGvNJ/qTAKmnWHqydUbZCor5BoCbQ+Nvhd2Nhtq91aUq6BtzPEGCb/uSsuKINxBItIfXMl1ssYbZqDunDZiChHnewM+gr5FWUwjlpPqAWilOFXMaqvcxNDmBWTsfmkc5NCpDLiPMJb5mr8EwNG17hvndTZhV450Wm96CTmSllDpJBPqmMvWvUtO3iRSNX//XSItq+LyvDIZJzpNiLDha0FhkbfZHxSGYyqkE8rw/cVdLbR/0whhMGEugF2/o4Jmg9eHwy95LB/OpjCt4lm03Ejhax0N1ZGMN7NymC0HNJrTEHxyeB8su+ZgB05F+/hbmUwXFIfCmVh+t+eVm4C7/rIZbtT0ReVwVj+snXuOR/e6nSAiW3U1HFikyF38ZAyGF1Czjr9zWQBQDe2qdzzBWUw9hRi8Gbnz5QymrzRW3vK4Gv2PTQlhMxxpe1PwOxmAwB/f0Ph09v13Sd1m/AYq3VvwFW7ovD19Ha8fzCMjIoG6Q2+PPR3YZ/ke3Z/enNSKWS2/TAj5o1k3GXTp4hxnxhG+C8QE+FNymAcPLh1+Ewlu6Hsm7gjl3wK0xwSvf+rxKzgW8pgLOWQFTJ+nZhvE8FY+G/zDbhZfhOo83obXA5ZwY5i3krQdTxD56Wtk/8vGc+hS8gsn/wyGShe+xgr4+pPjPS/5LCIXyLD5joM6r+NY8TAGZW86eYA+vZEhGDntTJF7/rxnfA5hA1cHeNtZER2jOpmSvnKg2EPqyFs85Pe8LqzWHJk0KhHiFcI7/L6O7v7Z6kOqwzb/8o+l217xslnn4dU/cDpK/29Iafc+hGuvZHZVsxKXf89/59Bh/0MOh8pxbV9mK2DB9n+JR9z3vssZaefMUnY/u2RgEHdBt6w43DpwVDiijrmpCCUv/69zpR1tYse3lXu3Th2nzxWHX9VHfUc0bRDd4F6/0bvfUMllxWyo4z1/mygEvUBETlcXZDAYrNPELT+q6Tm/M5P2rBzppetYTZRPMyWuWfxqueQHu5Whuu/k70jpaiWTyrlA/v1Sw+GEk9+Bn1FKb2c8prtg0VsK+RpZbjx3qAU2l36nMe/0eJ+xxbwSRkAAAAASUVORK5CYII=);background-repeat:no-repeat;background-position:center;background-size:cover;" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.png 480w, https://cecil.app/thumbnails/768x/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.png 768w, https://cecil.app/docs/cecil-newsite.94982e8ace758b40e6ff753807bdb42b.png 1007w" sizes="100vw">
</picture></a></p>
<aside class="note note-info"><p>Demo of the expected result: <a href="https://cecilapp.github.io/skeleton/" target="_blank" rel="noopener noreferrer">https://cecilapp.github.io/skeleton/</a>.</p></aside>
<h3 id="prerequisites">Prerequisites<a class="heading-anchor" href="#prerequisites" aria-hidden="true" tabindex="-1"></a></h3>
<ul>
<li><a href="https://php.net/manual/en/install.php" target="_blank" rel="noopener noreferrer">PHP</a> 8.3+</li>
<li>Terminal (a basic understanding of the <a href="https://wikipedia.org/wiki/Terminal_emulator" target="_blank" rel="noopener noreferrer">terminal</a>)</li>
<li>Text editor, such as <a href="https://code.visualstudio.com" target="_blank" rel="noopener noreferrer">VS Code</a> and/or <a href="https://typora.io" target="_blank" rel="noopener noreferrer">Typora</a></li>
</ul>
<h3 id="step-by-step">Step by step<a class="heading-anchor" href="#step-by-step" aria-hidden="true" tabindex="-1"></a></h3>
<div class="note note-steps" id="note-steps-1">
  <ol class="note-steps-list">
    <li class="note-step">
      <h4 id="download-cecil">Download Cecil</h4>
      <p>Download <code translate="no">cecil.phar</code> from your terminal:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">curl -LO https://cecil.app/cecil.phar</code></pre>
<p>You can also <a href="https://cecil.app/download/">download Cecil manually</a>, or install it globally with a package manager, then run <code translate="no">cecil</code> instead of <code translate="no">php cecil.phar</code>:</p>
<div class="note note-code-group" id="note-code-group-2">
  <section class="note-tab" id="note-code-group-2-1">
    <h4 id="homebrew">Homebrew</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">brew install cecilapp/tap/cecil</code></pre>
  </section>
  <section class="note-tab" id="note-code-group-2-2">
    <h4 id="scoop">Scoop</h4>
    <pre data-lang="bash"><code class="language-bash hljs bash" translate="no">scoop install https://cecil.app/scoop/cecil.json</code></pre>
  </section>
</div>
<p>See <a href="/documentation/installation/">Installation</a> for other methods.</p>
    </li>
    <li class="note-step">
      <h4 id="create-a-new-site">Create a new site</h4>
      <p>Create a directory for the website (e.g. <code translate="no">&lt;mywebsite&gt;</code>), put <code translate="no">cecil.phar</code> in it, then run the <code translate="no">new:site</code> command:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar new:site</code></pre>
    </li>
    <li class="note-step">
      <h4 id="add-a-page">Add a page</h4>
      <p>Run the <code translate="no">new:page</code> command:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar new:page</code></pre>
<p>Now you can edit the newly created page with your Markdown editor: <code translate="no">&lt;mywebsite&gt;/pages/&lt;new-page&gt;.md</code>.</p>
<aside class="note note-tip"><p>We recommend using <a href="https://www.typora.io" target="_blank" rel="noopener noreferrer">Typora</a> to edit your Markdown files.</p></aside>
    </li>
    <li class="note-step">
      <h4 id="check-the-preview">Check the preview</h4>
      <p>Run the following command to create a preview of the website:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar serve</code></pre>
<p>Then navigate to <code translate="no">http://localhost:8000</code>.</p>
<aside class="note note-info"><p>The <code translate="no">serve</code> command runs a local HTTP server and a watcher: if a file (a page, a template or the config) is modified, the browser’s current page is automatically reloaded.</p></aside>
    </li>
    <li class="note-step">
      <h4 id="build-and-deploy">Build and deploy</h4>
      <p>When you are satisfied with the result, you can generate the website in order to deploy it to the Web.</p>
<p>Run the following command to build the website:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar build</code></pre>
<p>You can now copy the content of the <code translate="no">_site</code> directory to a Web server 🎉</p>
    </li>
  </ol>
</div>
<aside class="note note-tip"><p>To deploy automatically on each push to your Git repository, see <a href="/commands/build/#deploy">Deploy</a>.</p></aside>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/commands/new-page/</id>
    <title>new:page</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/commands/new-page/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>new:page</h1>
<p>Creates a new page.</p>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Creates a new page

Usage:
  new:page [options] [--] [&lt;path&gt;]

Arguments:
  path                        Use the given path as working directory

Options:
      --name=NAME             Page path name
      --slugify|--no-slugify  Slugify file name (or disable --no-slugify)
  -p, --prefix                Prefix the file name with the current date (`YYYY-MM-DD`)
  -f, --force                 Override the file if already exist
  -o, --open                  Open editor automatically
      --editor=EDITOR         Editor to use with open option
  -h, --help                  Display help for the given command. When no command is given display help for the list command
      --silent                Do not output any message
  -q, --quiet                 Only errors are displayed. All other output is suppressed
  -V, --version               Display this application version
      --ansi|--no-ansi        Force (or disable --no-ansi) ANSI output
  -n, --no-interaction        Do not ask any interactive question
  -v|vv|vvv, --verbose        Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The new:page command creates a new page file.
  If you run this command without any options, it will ask you for the page name and other options.

    cecil.phar new:page
    cecil.phar new:page --name=path/to/a-page.md
    cecil.phar new:page --name=path/to/A Page.md --slugify

  To create a new page with a date prefix (i.e: `YYYY-MM-DD`), run:

    cecil.phar new:page --prefix

  To create a new page and open it with an editor, run:

    cecil.phar new:page --open --editor=editor

  To override an existing page, run:

    cecil.phar new:page --force</code></pre>
<h2 id="page-models">Page models<a class="heading-anchor" href="#page-models" aria-hidden="true" tabindex="-1"></a></h2>
<p>You can define your own models for your new pages in the <code translate="no">models</code> directory:</p>
<ol>
<li>A section model must be named after the section (e.g. <code translate="no">blog.md</code> for pages created in <code translate="no">blog/</code>)</li>
<li>The model for root pages must be named <code translate="no">default.md</code></li>
</ol>
<p>A page created in a section without a model uses the built-in model.</p>
<p>Two dynamic variables are available:</p>
<ol>
<li><code translate="no">%title%</code>: the title, derived from the file name (without extension, dashes replaced by spaces, first letter capitalized)</li>
<li><code translate="no">%date%</code>: the current date</li>
</ol>
<h2 id="open-with-your-editor">Open with your editor<a class="heading-anchor" href="#open-with-your-editor" aria-hidden="true" tabindex="-1"></a></h2>
<p>With the <code translate="no">--open</code> option, the page is opened automatically with the editor defined by the <code translate="no">editor</code> key of your configuration file (e.g. <code translate="no">editor: typora</code>), or with the one given by the <code translate="no">--editor</code> option.</p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/commands/serve/</id>
    <title>serve</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/commands/serve/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>serve</h1>
<p>Builds and serves the site locally.</p>
<aside class="note note-warning"><p>The web server is designed to aid website testing. It is not intended to be a full-featured web server and it should not be used on a public network.</p></aside>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Starts the built-in server

Usage:
  serve [options] [--] [&lt;path&gt;]

Arguments:
  path                             Use the given path as working directory

Options:
  -o, --open                       Open web browser automatically
      --host=HOST                  Server host [default: "localhost"]
      --port=PORT                  Server port [default: "8000"]
  -w, --watch|--no-watch           Enable (or disable --no-watch) changes watcher (enabled by default)
  -i, --incremental                Enable incremental builds (rebuild only changed pages)
  -d, --drafts                     Include drafts
      --optimize|--no-optimize     Enable (or disable --no-optimize) optimization of generated files
  -c, --config=CONFIG              Set the path to extra config files (comma-separated)
      --clear-cache[=CLEAR-CACHE]  Clear cache before build (optional cache key as regular expression) [default: false]
  -p, --page=PAGE                  Build a specific page
      --no-ignore-vcs              Changes watcher must not ignore VCS directories
  -m, --metrics                    Show build metrics (duration and memory) of each step
      --timeout=TIMEOUT            Sets the process timeout (max. runtime) in seconds [default: 7200]
      --notify                     Send desktop notification on server start
  -b, --background                 Run the server in the background
  -h, --help                       Display help for the given command. When no command is given display help for the list command
      --silent                     Do not output any message
  -q, --quiet                      Only errors are displayed. All other output is suppressed
  -V, --version                    Display this application version
      --ansi|--no-ansi             Force (or disable --no-ansi) ANSI output
  -n, --no-interaction             Do not ask any interactive question
  -v|vv|vvv, --verbose             Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The serve command starts the live-reloading-built-in web server.

    cecil.phar serve
    cecil.phar serve path/to/the/working/directory
    cecil.phar serve --open
    cecil.phar serve --drafts
    cecil.phar serve --no-watch

  To speed up local development you can enable incremental builds with the --incremental option.
  When content pages change, Cecil rebuilds just those pages.
  When templates change, Cecil rebuilds only pages using those templates (including Twig dependencies such as extends/include).
  Any other change (data, config, static or asset file, or file deletion) triggers a full rebuild:

    cecil.phar serve --incremental

  You can use a custom host and port by using the --host and --port options:

    cecil.phar serve --host=127.0.0.1 --port=8080

  To build the website with an extra configuration file, you can use the --config option.
  This is useful during local development to override some settings without modifying the main configuration:

    cecil.phar serve --config=config/dev.yml

  To start the server with changes watcher not ignoring VCS directories, run:

    cecil.phar serve --no-ignore-vcs

  To define the process timeout (in seconds), run:

    cecil.phar serve --timeout=7200

  Send a desktop notification on server start, run:

    cecil.phar serve --notify

  To run the server in the background, run:

    cecil.phar serve --background
    cecil.phar serve -b

  Then stop it with:

    cecil.phar serve:stop</code></pre>
<p>In background mode, file changes are not watched.</p>
<h2 id="serve-background">serve:background<a class="heading-anchor" href="#serve-background" aria-hidden="true" tabindex="-1"></a></h2>
<p>Alias of <code translate="no">serve --background</code>: starts the built-in server in the background without occupying the terminal. It accepts the same options as <code translate="no">serve</code>.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Starts the built-in server in the background (alias of `serve --background`)

Usage:
  serve:background [options] [--] [&lt;path&gt;]

Arguments:
  path                             Use the given path as working directory

Options:
  -o, --open                       Open web browser automatically
      --host=HOST                  Server host [default: "localhost"]
      --port=PORT                  Server port [default: "8000"]
  -w, --watch|--no-watch           Enable (or disable --no-watch) changes watcher (enabled by default)
  -i, --incremental                Enable incremental builds (rebuild only changed pages)
  -d, --drafts                     Include drafts
      --optimize|--no-optimize     Enable (or disable --no-optimize) optimization of generated files
  -c, --config=CONFIG              Set the path to extra config files (comma-separated)
      --clear-cache[=CLEAR-CACHE]  Clear cache before build (optional cache key as regular expression) [default: false]
  -p, --page=PAGE                  Build a specific page
      --no-ignore-vcs              Changes watcher must not ignore VCS directories
  -m, --metrics                    Show build metrics (duration and memory) of each step
      --timeout=TIMEOUT            Sets the process timeout (max. runtime) in seconds [default: 7200]
      --notify                     Send desktop notification on server start
  -b, --background                 Run the server in the background
  -h, --help                       Display help for the given command. When no command is given display help for the list command
      --silent                     Do not output any message
  -q, --quiet                      Only errors are displayed. All other output is suppressed
  -V, --version                    Display this application version
      --ansi|--no-ansi             Force (or disable --no-ansi) ANSI output
  -n, --no-interaction             Do not ask any interactive question
  -v|vv|vvv, --verbose             Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The serve:background command starts the built-in web server in the background.

    cecil.phar serve:background
    cecil.phar serve:background path/to/the/working/directory

  This command is an alias of serve --background.

  Stop the server with:

    cecil.phar serve:stop</code></pre>
<h2 id="serve-log">serve:log<a class="heading-anchor" href="#serve-log" aria-hidden="true" tabindex="-1"></a></h2>
<p>Displays the combined server and error logs, sorted by date.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Shows combined server and error logs

Usage:
  serve:log [options] [--] [&lt;path&gt;]

Arguments:
  path                  Use the given path as working directory

Options:
  -l, --lines=LINES     Number of entries to display [default: 25]
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The serve:log command displays entries from combined server and error logs.

    cecil.phar serve:log
    cecil.phar serve:log path/to/the/working/directory
    cecil.phar serve:log --lines=100
    cecil.phar serve:log -l 100</code></pre>
<p>Logs are read from the <code translate="no">.cecil/errors.log</code> and <code translate="no">.cecil/server.log</code> files, which is useful to debug issues with the local development server.</p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/configuration/locale-codes/</id>
    <title>Locale codes</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-16T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/configuration/locale-codes/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Locale codes</h1>
<p>Available locale codes (<code translate="no">language_COUNTRY</code>) used by the <a href="/documentation/languages/#languages"><code translate="no">languages</code></a> option.</p>
<h2 id="list-of-locale-codes">List of locale codes<a class="heading-anchor" href="#list-of-locale-codes" aria-hidden="true" tabindex="-1"></a></h2>
<table>
<thead>
<tr>
<th>Locale</th>
<th>Code</th>
</tr>
</thead>
<tbody>
<tr>
<td>Albanian (Albania)</td>
<td>sq_AL</td>
</tr>
<tr>
<td>Albanian</td>
<td>sq</td>
</tr>
<tr>
<td>Arabic (Algeria)</td>
<td>ar_DZ</td>
</tr>
<tr>
<td>Arabic (Bahrain)</td>
<td>ar_BH</td>
</tr>
<tr>
<td>Arabic (Egypt)</td>
<td>ar_EG</td>
</tr>
<tr>
<td>Arabic (Iraq)</td>
<td>ar_IQ</td>
</tr>
<tr>
<td>Arabic (Jordan)</td>
<td>ar_JO</td>
</tr>
<tr>
<td>Arabic (Kuwait)</td>
<td>ar_KW</td>
</tr>
<tr>
<td>Arabic (Lebanon)</td>
<td>ar_LB</td>
</tr>
<tr>
<td>Arabic (Libya)</td>
<td>ar_LY</td>
</tr>
<tr>
<td>Arabic (Morocco)</td>
<td>ar_MA</td>
</tr>
<tr>
<td>Arabic (Oman)</td>
<td>ar_OM</td>
</tr>
<tr>
<td>Arabic (Qatar)</td>
<td>ar_QA</td>
</tr>
<tr>
<td>Arabic (Saudi Arabia)</td>
<td>ar_SA</td>
</tr>
<tr>
<td>Arabic (Sudan)</td>
<td>ar_SD</td>
</tr>
<tr>
<td>Arabic (Syria)</td>
<td>ar_SY</td>
</tr>
<tr>
<td>Arabic (Tunisia)</td>
<td>ar_TN</td>
</tr>
<tr>
<td>Arabic (United Arab Emirates)</td>
<td>ar_AE</td>
</tr>
<tr>
<td>Arabic (Yemen)</td>
<td>ar_YE</td>
</tr>
<tr>
<td>Arabic</td>
<td>ar</td>
</tr>
<tr>
<td>Belarusian (Belarus)</td>
<td>be_BY</td>
</tr>
<tr>
<td>Belarusian</td>
<td>be</td>
</tr>
<tr>
<td>Bulgarian (Bulgaria)</td>
<td>bg_BG</td>
</tr>
<tr>
<td>Bulgarian</td>
<td>bg</td>
</tr>
<tr>
<td>Catalan (Spain)</td>
<td>ca_ES</td>
</tr>
<tr>
<td>Catalan</td>
<td>ca</td>
</tr>
<tr>
<td>Chinese (China)</td>
<td>zh_CN</td>
</tr>
<tr>
<td>Chinese (Hong Kong)</td>
<td>zh_HK</td>
</tr>
<tr>
<td>Chinese (Singapore)</td>
<td>zh_SG</td>
</tr>
<tr>
<td>Chinese (Taiwan)</td>
<td>zh_TW</td>
</tr>
<tr>
<td>Chinese</td>
<td>zh</td>
</tr>
<tr>
<td>Croatian (Croatia)</td>
<td>hr_HR</td>
</tr>
<tr>
<td>Croatian</td>
<td>hr</td>
</tr>
<tr>
<td>Czech (Czech Republic)</td>
<td>cs_CZ</td>
</tr>
<tr>
<td>Czech</td>
<td>cs</td>
</tr>
<tr>
<td>Danish (Denmark)</td>
<td>da_DK</td>
</tr>
<tr>
<td>Danish</td>
<td>da</td>
</tr>
<tr>
<td>Dutch (Belgium)</td>
<td>nl_BE</td>
</tr>
<tr>
<td>Dutch (Netherlands)</td>
<td>nl_NL</td>
</tr>
<tr>
<td>Dutch</td>
<td>nl</td>
</tr>
<tr>
<td>English (Australia)</td>
<td>en_AU</td>
</tr>
<tr>
<td>English (Canada)</td>
<td>en_CA</td>
</tr>
<tr>
<td>English (India)</td>
<td>en_IN</td>
</tr>
<tr>
<td>English (Ireland)</td>
<td>en_IE</td>
</tr>
<tr>
<td>English (Malta)</td>
<td>en_MT</td>
</tr>
<tr>
<td>English (New Zealand)</td>
<td>en_NZ</td>
</tr>
<tr>
<td>English (Philippines)</td>
<td>en_PH</td>
</tr>
<tr>
<td>English (Singapore)</td>
<td>en_SG</td>
</tr>
<tr>
<td>English (South Africa)</td>
<td>en_ZA</td>
</tr>
<tr>
<td>English (United Kingdom)</td>
<td>en_GB</td>
</tr>
<tr>
<td>English (United States)</td>
<td>en_US</td>
</tr>
<tr>
<td>English</td>
<td>en</td>
</tr>
<tr>
<td>Estonian (Estonia)</td>
<td>et_EE</td>
</tr>
<tr>
<td>Estonian</td>
<td>et</td>
</tr>
<tr>
<td>Finnish (Finland)</td>
<td>fi_FI</td>
</tr>
<tr>
<td>Finnish</td>
<td>fi</td>
</tr>
<tr>
<td>French (Belgium)</td>
<td>fr_BE</td>
</tr>
<tr>
<td>French (Canada)</td>
<td>fr_CA</td>
</tr>
<tr>
<td>French (France)</td>
<td>fr_FR</td>
</tr>
<tr>
<td>French (Luxembourg)</td>
<td>fr_LU</td>
</tr>
<tr>
<td>French (Switzerland)</td>
<td>fr_CH</td>
</tr>
<tr>
<td>French</td>
<td>fr</td>
</tr>
<tr>
<td>German (Austria)</td>
<td>de_AT</td>
</tr>
<tr>
<td>German (Germany)</td>
<td>de_DE</td>
</tr>
<tr>
<td>German (Luxembourg)</td>
<td>de_LU</td>
</tr>
<tr>
<td>German (Switzerland)</td>
<td>de_CH</td>
</tr>
<tr>
<td>German</td>
<td>de</td>
</tr>
<tr>
<td>Greek (Cyprus)</td>
<td>el_CY</td>
</tr>
<tr>
<td>Greek (Greece)</td>
<td>el_GR</td>
</tr>
<tr>
<td>Greek</td>
<td>el</td>
</tr>
<tr>
<td>Hebrew (Israel)</td>
<td>he_IL</td>
</tr>
<tr>
<td>Hebrew (Israel, legacy code)</td>
<td>iw_IL</td>
</tr>
<tr>
<td>Hebrew</td>
<td>he</td>
</tr>
<tr>
<td>Hebrew (legacy code)</td>
<td>iw</td>
</tr>
<tr>
<td>Hindi (India)</td>
<td>hi_IN</td>
</tr>
<tr>
<td>Hindi</td>
<td>hi</td>
</tr>
<tr>
<td>Hungarian (Hungary)</td>
<td>hu_HU</td>
</tr>
<tr>
<td>Hungarian</td>
<td>hu</td>
</tr>
<tr>
<td>Icelandic (Iceland)</td>
<td>is_IS</td>
</tr>
<tr>
<td>Icelandic</td>
<td>is</td>
</tr>
<tr>
<td>Indonesian (Indonesia)</td>
<td>id_ID</td>
</tr>
<tr>
<td>Indonesian (Indonesia, legacy code)</td>
<td>in_ID</td>
</tr>
<tr>
<td>Indonesian</td>
<td>id</td>
</tr>
<tr>
<td>Indonesian (legacy code)</td>
<td>in</td>
</tr>
<tr>
<td>Irish (Ireland)</td>
<td>ga_IE</td>
</tr>
<tr>
<td>Irish</td>
<td>ga</td>
</tr>
<tr>
<td>Italian (Italy)</td>
<td>it_IT</td>
</tr>
<tr>
<td>Italian (Switzerland)</td>
<td>it_CH</td>
</tr>
<tr>
<td>Italian</td>
<td>it</td>
</tr>
<tr>
<td>Japanese (Japan)</td>
<td>ja_JP</td>
</tr>
<tr>
<td>Japanese (Japan, JP)</td>
<td>ja_JP_JP</td>
</tr>
<tr>
<td>Japanese</td>
<td>ja</td>
</tr>
<tr>
<td>Korean (South Korea)</td>
<td>ko_KR</td>
</tr>
<tr>
<td>Korean</td>
<td>ko</td>
</tr>
<tr>
<td>Latvian (Latvia)</td>
<td>lv_LV</td>
</tr>
<tr>
<td>Latvian</td>
<td>lv</td>
</tr>
<tr>
<td>Lithuanian (Lithuania)</td>
<td>lt_LT</td>
</tr>
<tr>
<td>Lithuanian</td>
<td>lt</td>
</tr>
<tr>
<td>Macedonian (North Macedonia)</td>
<td>mk_MK</td>
</tr>
<tr>
<td>Macedonian</td>
<td>mk</td>
</tr>
<tr>
<td>Malay (Malaysia)</td>
<td>ms_MY</td>
</tr>
<tr>
<td>Malay</td>
<td>ms</td>
</tr>
<tr>
<td>Maltese (Malta)</td>
<td>mt_MT</td>
</tr>
<tr>
<td>Maltese</td>
<td>mt</td>
</tr>
<tr>
<td>Norwegian (Norway)</td>
<td>no_NO</td>
</tr>
<tr>
<td>Norwegian (Norway, Nynorsk)</td>
<td>no_NO_NY</td>
</tr>
<tr>
<td>Norwegian</td>
<td>no</td>
</tr>
<tr>
<td>Polish (Poland)</td>
<td>pl_PL</td>
</tr>
<tr>
<td>Polish</td>
<td>pl</td>
</tr>
<tr>
<td>Portuguese (Brazil)</td>
<td>pt_BR</td>
</tr>
<tr>
<td>Portuguese (Portugal)</td>
<td>pt_PT</td>
</tr>
<tr>
<td>Portuguese</td>
<td>pt</td>
</tr>
<tr>
<td>Romanian (Romania)</td>
<td>ro_RO</td>
</tr>
<tr>
<td>Romanian</td>
<td>ro</td>
</tr>
<tr>
<td>Russian (Russia)</td>
<td>ru_RU</td>
</tr>
<tr>
<td>Russian</td>
<td>ru</td>
</tr>
<tr>
<td>Serbian (Bosnia and Herzegovina)</td>
<td>sr_BA</td>
</tr>
<tr>
<td>Serbian (Montenegro)</td>
<td>sr_ME</td>
</tr>
<tr>
<td>Serbian (Serbia)</td>
<td>sr_RS</td>
</tr>
<tr>
<td>Serbian (Serbia and Montenegro)</td>
<td>sr_CS</td>
</tr>
<tr>
<td>Serbian</td>
<td>sr</td>
</tr>
<tr>
<td>Slovak (Slovakia)</td>
<td>sk_SK</td>
</tr>
<tr>
<td>Slovak</td>
<td>sk</td>
</tr>
<tr>
<td>Slovenian (Slovenia)</td>
<td>sl_SI</td>
</tr>
<tr>
<td>Slovenian</td>
<td>sl</td>
</tr>
<tr>
<td>Spanish (Argentina)</td>
<td>es_AR</td>
</tr>
<tr>
<td>Spanish (Bolivia)</td>
<td>es_BO</td>
</tr>
<tr>
<td>Spanish (Chile)</td>
<td>es_CL</td>
</tr>
<tr>
<td>Spanish (Colombia)</td>
<td>es_CO</td>
</tr>
<tr>
<td>Spanish (Costa Rica)</td>
<td>es_CR</td>
</tr>
<tr>
<td>Spanish (Dominican Republic)</td>
<td>es_DO</td>
</tr>
<tr>
<td>Spanish (Ecuador)</td>
<td>es_EC</td>
</tr>
<tr>
<td>Spanish (El Salvador)</td>
<td>es_SV</td>
</tr>
<tr>
<td>Spanish (Guatemala)</td>
<td>es_GT</td>
</tr>
<tr>
<td>Spanish (Honduras)</td>
<td>es_HN</td>
</tr>
<tr>
<td>Spanish (Mexico)</td>
<td>es_MX</td>
</tr>
<tr>
<td>Spanish (Nicaragua)</td>
<td>es_NI</td>
</tr>
<tr>
<td>Spanish (Panama)</td>
<td>es_PA</td>
</tr>
<tr>
<td>Spanish (Paraguay)</td>
<td>es_PY</td>
</tr>
<tr>
<td>Spanish (Peru)</td>
<td>es_PE</td>
</tr>
<tr>
<td>Spanish (Puerto Rico)</td>
<td>es_PR</td>
</tr>
<tr>
<td>Spanish (Spain)</td>
<td>es_ES</td>
</tr>
<tr>
<td>Spanish (United States)</td>
<td>es_US</td>
</tr>
<tr>
<td>Spanish (Uruguay)</td>
<td>es_UY</td>
</tr>
<tr>
<td>Spanish (Venezuela)</td>
<td>es_VE</td>
</tr>
<tr>
<td>Spanish</td>
<td>es</td>
</tr>
<tr>
<td>Swedish (Sweden)</td>
<td>sv_SE</td>
</tr>
<tr>
<td>Swedish</td>
<td>sv</td>
</tr>
<tr>
<td>Thai (Thailand)</td>
<td>th_TH</td>
</tr>
<tr>
<td>Thai (Thailand, TH)</td>
<td>th_TH_TH</td>
</tr>
<tr>
<td>Thai</td>
<td>th</td>
</tr>
<tr>
<td>Turkish (Turkey)</td>
<td>tr_TR</td>
</tr>
<tr>
<td>Turkish</td>
<td>tr</td>
</tr>
<tr>
<td>Ukrainian (Ukraine)</td>
<td>uk_UA</td>
</tr>
<tr>
<td>Ukrainian</td>
<td>uk</td>
</tr>
<tr>
<td>Vietnamese (Vietnam)</td>
<td>vi_VN</td>
</tr>
<tr>
<td>Vietnamese</td>
<td>vi</td>
</tr>
</tbody>
</table>
<hr>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/commands/build/</id>
    <title>build</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-11-01T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/commands/build/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>build</h1>
<p>Builds the site.</p>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Builds the website

Usage:
  build [options] [--] [&lt;path&gt;]

Arguments:
  path                               Use the given path as working directory

Options:
  -d, --drafts                       Include drafts
  -u, --baseurl=BASEURL              Set the base URL
  -o, --output=OUTPUT                Set the output directory
      --optimize|--no-optimize       Enable (or disable --no-optimize) optimization of generated files
      --dry-run                      Build without saving
  -c, --config=CONFIG                Set the path to extra config files (comma-separated)
      --clear-cache[=CLEAR-CACHE]    Clear cache before build (optional cache key as regular expression) [default: false]
  -p, --page=PAGE                    Build a specific page
      --render-subset=RENDER-SUBSET  Render a subset of pages
      --show-pages                   Show list of built pages in a table
  -m, --metrics                      Show build metrics (duration and memory) of each step
      --notify                       Send desktop notification on build completion
  -h, --help                         Display help for the given command. When no command is given display help for the list command
      --silent                       Do not output any message
  -q, --quiet                        Only errors are displayed. All other output is suppressed
  -V, --version                      Display this application version
      --ansi|--no-ansi               Force (or disable --no-ansi) ANSI output
  -n, --no-interaction               Do not ask any interactive question
  -v|vv|vvv, --verbose               Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The build command generates the website in the output directory.

    cecil.phar build
    cecil.phar build path/to/the/working/directory
    cecil.phar build --baseurl=https://example.com/
    cecil.phar build --output=_site

  To build the website with optimization of generated files, you can use the --optimize option.
  This is useful to reduce the size of the generated files and improve performance:

    cecil.phar build --optimize
    cecil.phar build --no-optimize

  To build the website without overwriting files in the output directory, you can use the --dry-run option.
  This is useful to check what would be built without actually writing files:

    cecil.phar build --dry-run

  To build the website with a specific subset of rendered pages, you can use the --render-subset option.
  This is useful to build only a part of the website, for example, only "hot" pages or a specific section:

    cecil.phar build --render-subset=subset

  To show build steps metrics, run:

    cecil.phar build --metrics

  Send a desktop notification on build completion, run:

    cecil.phar build --notify</code></pre>
<h2 id="deploy">Deploy<a class="heading-anchor" href="#deploy" aria-hidden="true" tabindex="-1"></a></h2>
<p>By default, the site is built in the <strong><code translate="no">_site</code></strong> directory, and <strong>can be deployed as is</strong> to any web server or static hosting service.</p>
<p>To build and deploy the site automatically on each push to a Git repository, Cecil provides:</p>
<ul>
<li>
<p>a <strong>build script</strong>, to use as build command on a Jamstack platform or a CI service:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">curl -sSOL https://cecil.app/build.sh &amp;&amp; bash ./build.sh</code></pre>
<p>It downloads Cecil (or its <a href="/getting-started/installation/#standalone-binary">standalone binary</a> if PHP is not available), installs themes and builds the site, deducing the build context (<code translate="no">production</code> or <code translate="no">preview</code>) and the base URL from the platform.<br>
Set the <code translate="no">CECIL_ENV</code> environment variable to force the build context, <code translate="no">CECIL_VERSION</code> to use a specific Cecil release and <code translate="no">CECIL_CMD_OPTIONS</code> to add options to the <code translate="no">build</code> command (e.g.: <code translate="no">--optimize</code>); other variables prefixed with <code translate="no">CECIL_</code> override the <a href="/configuration/">configuration</a> (e.g.: <code translate="no">CECIL_OUTPUT_DIR</code>).</p>
</li>
<li>
<p>a <strong>GitHub Action</strong>, <a href="https://github.com/Cecilapp/Cecil-Action" target="_blank" rel="noopener noreferrer">Cecil Action</a>, to build the site in a GitHub Actions workflow: the <a href="/documentation/new-site/"><code translate="no">new:site</code></a> command can create a workflow that deploys to GitHub Pages.</p>
</li>
</ul>
<aside class="note note-tip"><p>See <a href="https://cecil.app/documentation/deploy/">Deploy</a> for ready-to-use configurations (Netlify, Vercel, Cloudflare Pages, GitHub Pages, GitLab CI, etc.).</p></aside>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/getting-started/starter-kits/</id>
    <title>Starter kits</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-10T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/getting-started/starter-kits/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Starter kits</h1>
<p>To get started quickly, use one of Cecil's ready-to-use <a href="https://cecil.app/starter-kits/">starter kits</a>.</p>
<h2 id="available-starter-kits">Available starter kits<a class="heading-anchor" href="#available-starter-kits" aria-hidden="true" tabindex="-1"></a></h2>
<ul>
<li><a href="https://github.com/Cecilapp/the-butler#readme" target="_blank" rel="noopener noreferrer">The Butler</a>: a publishing-ready starter blog.</li>
<li><a href="https://github.com/Cecilapp/Links#readme" target="_blank" rel="noopener noreferrer">Links</a>: an open source Linktree alternative.</li>
<li><a href="https://github.com/Cecilapp/photo-stream#readme" target="_blank" rel="noopener noreferrer">Photo Stream</a>: a super simple self-hosted photo stream.</li>
<li><a href="https://github.com/Cecilapp/statidocs#readme" target="_blank" rel="noopener noreferrer">Statidocs</a>: build a documentation website quickly.</li>
</ul>
<p><a href="https://github.com/Cecilapp/the-butler#readme" target="_blank" rel="noopener noreferrer"><picture>
<source type="image/avif" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.avif 480w, https://cecil.app/thumbnails/768x/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.avif 768w, https://cecil.app/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.avif 1014w" width="1014" height="713" sizes="100vw">
<source type="image/webp" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.webp 480w, https://cecil.app/thumbnails/768x/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.webp 768w, https://cecil.app/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.webp 1014w" width="1014" height="713" sizes="100vw">
<img src="https://cecil.app/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.png" alt="Starter blog example" loading="lazy" decoding="async" class="dark:brightness-90" width="1014" height="713" style=";max-width:100%;height:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABGCAYAAAA6hjFpAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAU/UlEQVR4nN2c65Lcuq1GP4CUepz3f59UnSfK3qlKPC0SOD8AkKBaPRfHsWeHLprqaV2xiAtBqunvf/8/RSqqClUFoGl7FiKAiAAQiMi3nxf7mk7HYTmeiMG81lIYzAVEBGZervWz2vzM1r75KKeiT9p1+yy/90pdD1CoPocSglSN7bcvSASoEojUWyzbcR7meZ0sHFV9F/hfq7wPp7bWlgPOQAA8ALHt97UjHzO1gR4+n6GLxH6zU3xeC/z6797hrysfUZb6+vqaDxlAPkLzo703C3+tq3myaxaswKZwz9f9KJSPlsvdhyX43Ll+tNR//etf6aP6hX/u1a9gGIiSanVNAQIIM0HVqt1TBvSWT/HrfvpG3/j4i8DUf/7zn+njjzujZ2X2ctOIDKPWilIKtm1DrR2qAkDdr5CbLnYfk3v8GlA8gPikarylGc/PRC6j2Vk+3JH1+Z71zz//XPe82P5RNllg0eMtijIYtVZs24bWGvZ9T34k9rX9TUMYD1pCAC1RW7r2p270zY9+T88OtHt6DuctUI9/r3/++cfDDh8H8N6OEwiz9fZSGKVMGPu+43bbIdIHkAyOWaDKlxpLyFqxtp9BcmWa6Nkeyxf6sOe59xMUuuzztszqP/7xj9Ofrg/4cS2Z5spglGGmDMYNvb9AZMKI/UQKVAtE1MzWZ6/9yS/paivtl8VvJvQd6AoouY5oDAMw/zCa+WT1jz/+mEefz/euBD4iotVc1VpQ64Zt23C73XAcDSIyHpAdWJg0+06hUMBb63PkdxDb/oDjG/8LDT19cnfLTs814/xp6fSLgzsZqbPJIkBl3t+p1D/+yBqy7vIekPcisuxDIrw1QZt2HMeB3jvMkZtm1K1g2yr2bmbMgMiA4Vyg5P5GybYVABFIHZF/DyX/Ktt0///BEq1/uEK4niV6/KkT5PM/iCeZsCS/kGXSkKvyWfN1euhhrnJkNbWj9z4GfQajYr/vaHtDaw29G4w8ih+a8nAP6emHb7UN8uxCFrJGIDBv93S2a0+/gIhLjL+lzMLsI4ubn7tPZ6Pp/1PYe1V+xHmcgUz/EdqxwijY9w37fsNxu6M105wuHSIGQlTB0UIh6k59XO3CwZ5uaWgTCNbMDjSPnmd7piXxbEMyAw4NLY7OAMzrkmZp0rx+NKrngeGz8n409SwsDO2Y/qM5DBmase8b7vcbjuOO42horaN38y2iVtVbEoIwwELQGGh6bgzRQ1Nr5sQhYJqS+Rd7vClgjTsfTjk/z/Xja+rwJugY4D74D/JrDAg5VfWQOrkq72vI82gjO/SC1gq2LWDAo62K+/2O4zjcTDXXDjEgqZIIQAQWQJlBGr5hdoh1kEgOxH1KbCfzRS5A0tVMhSZBs785yeLh4xrznuNCHclaeJZuPYmqnpOLV+WjkdSTb4YP6R7G6oim6nFgP8xfWO1obqp6F3SZlUUAEShcQ0KoI1kZd+J/d4lTQCEeA0oiHRpAA0w6/uo5FjGcXfhZYidTdPIXA0SAyRqiHoL9Z+XKyc5CRCN8BWAOvjb0rBFdzGd0Qe+P2tFFoCLgMD2kA0YObScQOIgAopaGWZKWCtLQIvMkQ7MiAiIMu7U45NPzX0VUy8dI2GrWEl0iJFVFfV/Y/3lZ0+uUIDgI1wYRHaaqnyqJQLqYv/AxSx6ejx4+NIWGBkUO7REKDW1ZNeXam08tSRryNI640qKI2ddIcdGQjwr1ZxRVfej5w3G74EUVPaoomgiKCNAFBEFESHrKyy8g4nMWeiQ2SQcQHv4l+5P1nq/k/SR+uQ7NwmzG6CNpyqhJPr8cyKgufD1VkVkNiIK7WtgIsYEeqwHx+GkKgK41xJ06O4QFSJirRY7zAw37P2Ko5PwXjz/biyx0DtHJgdAFmF8KJMoZQowzooaGNDUgJKZZMcATYSiRO0haQlNK/00YDgS0mCsOX7KExKsjiFFJbh81ZDWf0THmtWEdAQCTAWEAFGY8xjG/WkNyGdEF5ixlwBCd2nGIaRN30w4RQMiq68zqPE/aQicwvEDC1BCcBE0hfHVFUK/LJeanEWDk87tGMqEQoRBQ4GYTEw6FtuA3aMgM+/xzaKxvDxhqMKgrelcAAhWCENBJIQAkAdF0fmANewNMCIuTKZtmzYXt5ik0ggeICWgFN0FYGwEETxBMqMQoDFQiVMIAxAky4R0NeTbg+xmziQsIT4WYyYKZKxEcEep2gSpBiNBJ0UFoIAgUPQ2yroxNaACWNmvPqh0TzATBEJBqEp7OAID8CCIAbECYwLFegBkbEyoztkLYmLERUNnBwDSFPeR+BDKcHCWnRANEDOyu1mx9jMSD5CYUYJitJgrykBjUIUzoBDRiNAUagK5W7bh5rvVxUtQ1nP7qOzBMRzJNDoChYJW5nTSEyKM9sEd9DoQYxMUSpszYCmNnxi6MW1EIE0QJyub/ij8/4QTk+eoQGsI/R0rhCz5HZLaev3VzhRTu2h9aFwgEwh2NgAOKQ4FDYWAU6OGHLoBMTUFq07jF/2YagRWGgygQFDVNKaEl40BDKA5DqYB8trOUgo0Zey24FUaTYpFl8WlpJSCguMJNIDn6YB42cAzAEpAYdQuw/P2zUBYYgJst6/VNFSoKdSCHEA4C7kq4K+FQxd33637cNZB5vSUCG0Cm7xgmKgEpEFQ1EBVTUyIgUDIY4jDglYugFsFWCm6iaNVgAMXgVwaD7dps98KgCWREIWk5J7GNakfXSiZLRBZAn4GyCC45dMU0Q01g45GuaCo4mHAH8KqE7wLcVXEX4HAgXRPgt4CM550Xz86aQxNUHYaioqOqoMKqDS4dJzE6MYQKJIBwAZdqQKqgiZlhRYF7Gg+D7Tyc4vZqsl7N0xlKfpAAElV6B8iinc9AyZKLTXFN6W6KSCzCaqp4FcErgO8K/FuAVwHuojgktERPEdcpZZG2Kf2ZEqzQjDBRAWFTwYaODYJKgpKACDEEjE4FggolAVjBRVGqYpfp35jIoiwmbELoTOhiEReTPXsdyTcmt3082qjh6BWAiqxhn1qvJJGx/dFyDlcDSlcPPwXoojiguJPiuwr+LQbkezcgd1HzI6qQoSF6gvIMyNxmd+rFzVJ1IDsEDYKODiFBxwpEiSAoaKToMLegBLAAVc15gwjMgto77ky4MaOx+UohGv6TAdThOzA1hekEJ4W/glMeKUEQB/PZ6OsBCgwK3EccorjDfMarAN9F8b0Drz0cfPiRgLKi1rRN6YqU/kaK4R+KqmuGQiBQEhC6B9oCXTTErEMnWCjufoXV4ClZ2F674N4ZregwYWe/p3ANyTCI+RFK0hBGMkua+qHqmMFD3ucTUDKQuF5XoEHRPLq6u6l6FeBVVsfeY+S/nG3qTIaRNSVCXgNiWiJqgThFtEVpkKjq6Ro1HwJFI6vRIcj9H7Pi6AYhale1jINi5BrjtmrAGOMPXPiUiOUBKK+L1gLGoilvmK/T9d8FJAA6PMSV0BjTitCOpma2RJ/DiG1arjw1JaAU04Gxr3sGC8ehKH5PcZwoIA5CYPtIXMfvLUL5ma/DY8oHASTBiLgaJyDj+1RyAKAasft0+ppC5R8tAWSGw1MTpub4IBHPteMRzgoEiEGh7QF37j2uj0jV+FlcfecZ579hMhOkUTWF51e3h4iyHMbMqZyEn74ff3PN0dTm7TyY/E+LDqGQ+wmHAgMRgvv8WWcbwgWwCh9ww6Wjg4xDKYfs67+1E5yuHBb/4q7qEL9eAAtT9ERDNGvQucY+PxHK0JhT/TlXAABPCfm2md2AEcPGc5hwFr16iDi7/XVG8LpU+MXGRExASDXy9s8efJi7c/sTYZzbC23/SSWLjxEhRmiKmZ4pLyHTXlUApCCOHJ8+nDVlWx6uFKWqArFCO08WkchiBs6Z32W2D0jCP7f/nfLzQNDDJwKNTmhak0yWWpARd2E+wRbChRzyHEeeQ4mE5uNVZ6nmxNydqfhLMisMBWYaGzhNuca8eFpNoTGB/9+F8vNKCMln9ZIQTTYGJWCQTi1QABLyYkuMEM8gIc7HZx/9hEid4alCxFWUVnNAkS7xg8IvjCSjA4k6xstfmsea2XJRugDJobi5iplKj/CgaqsoTTrm9AmWwYWA/PUJ9siT7SzeruYLp1rXniyWd+nJj4iMfNZ5XgRYoYyUvP409/ELyjBSQ3hDcEq2bksA9XEEfMGeaJ++lciSigUgMIht2RKN4UCCESOLJ3ezvKdu/sSWa4ZmKNFYwnlOMob/0IARGvID6ZNfX+Y43WBQ0pAQ4Ixr1deMae9Q6SDpGLkwIoBcM5QAn6BiERvl61lbrocYBI+yAEybL5aPCTMVeas8FsmTVdGe69ctlNoJI4TEhGH/I3pVUUgXoDdob5DWAOnWUWFrvlAKON4CIwYKg6RcwJjTtVfm62EKN0/T5ulce4YVyNjfNr44COCxPwaOtExHp80nD6u0m2b01kDHAbQD6M3MF9y/lopSxRfxMbQUoApI+jBdVk/mKnl515DronlQ+Iag15D3K5crGNlcxcSRQ4kxmQSMA7gfwHGHHnegHWa64FmLUqGbASnsQHoF+gaEP3kSBr+pIQ/lSZLwd5erFM/HjoqWJwyakRX7uMxCXoVKN1N1HND7HXp/hR6v0OMO9dfxmBhc65grKoUhtdr3YdpEbBA/7mCCGOvG8JtWLv6Mco4Y3+40q9/wWMjWRo3Wl+S4vTftMBjSDuhxQI5XyOt3yP37BKIKYkap2zD1pdpbxtqaBwGW/Z4LKbKGrNHXXwIIXbRRI7nxHMhpvEGmGdcwYlCoIBVAOrQ3aDsgxx39bkD663fI8To0hLhAxLWFGXXbIK1BenMY4mZfR2Q2zNXI/f3FNCQDuKoATq+f2VGUtylWLmYYZrKKpnB3jDc6xKMqaXfI3aD0+3f04w7tDVC1H85RARNBajV47mNU+piJGtEb/gc05AyjwG4+UjydVi3JthpwO008FlyX0c70BilNc6Xden3vQD8g7YC0O3q7ox9305DWQACkFFukUIoB7A0qfrxrCC4d+l/Qh5xhFO9FhYDqCWpzyss0BfJyUcQD+8s64T/CoZMCHKkQsbyuqr9CN6A0N1/WRugbyRNlBvU0PvF36yeIMFVpDJJA/CU0JGDEqvHKtpKjsmJXkyQBDxNUNnl2stHkMZVPojE4DQIVZMvpfdXInI5SeJpEbEzBambI3gi2q441VkiL7JDm4L3DjFci/JgvoSHZhr71XfT4AgOyEdCEsLFih00VEMz2x0QVMGGsr61NGMs2CJEqBwEKgQogbPMcNh7WCclvjvz7eAhmW2sV1Va7W1vY74fn+qtI1PJX1pB1hDAdNQi+XJPQvar3tErii61jxQsWGEwzqsKyHa+OesgsApsDJ6gQeicIExoDVMhWsxcCF0YvDCkFWsv4YRmuFaVWbFvFbSvYK2OrjL3YQutabBV8ACocv470BTQkl2fhbPgKYut9VGgaAAZIFJWBQ9JKE3+4ADKhxEI/9qcf7/ECmHM32n31iHb0zuiVUWpBrQWtFvStou8VXXZbq8Uwf+Fpk7rvqLcd+77jZd/xslXsW8FeC/ZSBpgaYNI9xij9S2jI2UwxucMmg6GFwYVnhKTmzA9RNGVfwKwJxoWGkJ89tQr3GT63IWwrE0ULutcmFb1X9Lahy46u3bxKIWirAwiXirLtqLcXbN9ecHu54eV2G2BuW8GtlqExW9KWWNAeYH4fkJMjMaeXgPgNo/jvpDCjEKMqsCvG8tERWZ2A5FfXwlwBtjg6kiNzuoAgBeisEFJ06ui6oWtD1xu6dnQS8y2FIEe1CEstVWJANtT9BdvLN2x/+4bbtxe8vOz4223H3/YN37ZqUKq9uBOaYgsS8XuBZBY5HrfxhTtFf+uIC0NqgXCxl3VA42WdPELPQHkxBw7lDAMxXotpaPuFCGFFZ7HX5kgchKIXQCpDbtXyWj4oHIvTtw1lu2F7MSj7t2+4vbzg28uOb/uGb3s1M1YKtjBhCUo4+6/hQ8I5pmikMmEv9uM0qJY97b70v2OulF+PpweTFWOQMFMarc9q2o/bMLQTpBB6BaREVUgFemXIVqC3DXLcoO2wPJcqEEBqBW876n7DdnvB9vKC/SXM146XveJlK7ht4ewpOXkeCc6v40NcmAYD2JiwF0atDK4FWgqUiy9uDsHOEuOOKw3B0BBrBRjvo8wpaIb0CUaq142hW4EcFdp2SAwII2FIZGugSwHXDWXbUfYbtn3Hdrth383R3/YN+1ZxqxV7Ne2ozBYep3HTbwcCZIfuUJgMCBO2YtEOVXsRRokhQ8B+fIS8mFDjAZGBBMiAofYSjfqvSWhn8yfN4WwF2irktkHbDm3NR+zdR+Lw6IhBhcGlOhQDUzf7sbZt37HVin2r2Oo0WaEdhedE4G8Dch4gjkjLe0x1GKElpRYQFyjHu3w+jnCB8xlI+m6EuDR/bMDWU8WUM88FGsLQ2l1bqtdtgvD8VEzgkTtAYrs/qvb2VKkVpW7jtyOtFtRSzHe4D5najN8/DokS0VDAGO92Dyg2HmAu5mSIZ88f/iKAJD8CzOlnrL/8EBOCAQVi69JUGCrFa4dKtVxWThT61G1oCEDjvqj4AofiYJZf7y6uEeHM2Q7zjgR8ASARYQFTxlNLLGbfPH4v/rBE7E6DzWRg9rJIHs5cVlzFI7LkewyKzpUl4/cdBZDibQIRCcOrKevRQfw1QHYw8fvDxbXBgXDqSNlK/HYgUUb4CzpBMX+yxYMUBlFxINNxZ43IJmDMiCQw8XmRazJdU/ACaEnb7yw4S1Dgzp7SDwlYiJzvl2Zn9FN8GSAARvpg+Y2QVGt+ETXefUz+Ijv3Ob6h0wXWCy4rBiINozyFHzCQYDzTkGhTuH35dkC6P7+r0X4ZIFk7punCcNJReZiEmRaZQJAyqXbW+eDXmmIvFo1Ps41VN2Nl5ztAMuw09qF0H6GvlPal01m+BJCQUY68RtSFuapwaA5NGA8mihLUabBcSOmK/kHH9vDQGGA8TzagaP4ubfv549yUHihfc/QFTc99Kl8CCJA7Lp3+Tce/vvd4MlPDh0wtQYaSNIOAGTaPG0jiyQkynS94Lpp0BvKgIfPvD4K/IuHlawA5CWts5IoEBifzlnaYqywfYTxsAyuI0XW9GyuGcB+MlFFN36z+iU6fl2d7Iy74f6jmha4vUMMBAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:center;background-size:cover;" srcset="https://cecil.app/thumbnails/480x/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.png 480w, https://cecil.app/thumbnails/768x/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.png 768w, https://cecil.app/docs/cecil-newblog.c85c682e3bcb416589e2bc2bbcc2cfca.png 1014w" sizes="100vw">
</picture></a></p>]]>
    </content>
  </entry>
  <entry xml:lang="en">
    <id>https://cecil.app/documentation/commands/doctor/</id>
    <title>doctor</title>
    <published>2020-12-19T00:00:00+00:00</published>
    <updated>2026-10-19T00:00:00+00:00</updated>
    <link href="https://cecil.app/documentation/commands/doctor/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>doctor</h1>
<p>Diagnoses the current site and Cecil environment.</p>
<h2 id="usage">Usage<a class="heading-anchor" href="#usage" aria-hidden="true" tabindex="-1"></a></h2>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Diagnoses the site configuration

Usage:
  doctor [options] [--] [&lt;path&gt;]

Arguments:
  path                  Use the given path as working directory

Options:
  -c, --config=CONFIG   Set the path to an extra configuration file
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The doctor command diagnoses the current site and Cecil environment.

    cecil.phar doctor
    cecil.phar doctor path/to/the/working/directory

  To inspect a site with an extra configuration file, run:

    cecil.phar doctor --config=config.yml</code></pre>
<h2 id="doctor-cache">doctor:cache<a class="heading-anchor" href="#doctor-cache" aria-hidden="true" tabindex="-1"></a></h2>
<p>Shows the cache settings (enabled caches, directory) and usage (number of files and size of each cache pool).</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Shows cache status

Usage:
  doctor:cache [&lt;path&gt;]

Arguments:
  path                  Use the given path as working directory

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The doctor:cache command shows cache settings and usage details.</code></pre>
<h2 id="doctor-frontmatter">doctor:frontmatter<a class="heading-anchor" href="#doctor-frontmatter" aria-hidden="true" tabindex="-1"></a></h2>
<p>Validates pages front matter syntax.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Validates pages front matter syntax

Usage:
  doctor:frontmatter [options] [--] [&lt;path&gt;]
  doctor:fm

Arguments:
  path                  Use the given path as working directory

Options:
  -c, --config=CONFIG   Set the path to an extra configuration file
  -p, --page=PAGE       Validate a single page relative to the pages directory
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The doctor:frontmatter command validates front matter syntax for pages.

    cecil.phar doctor:frontmatter
    cecil.phar doctor:frontmatter path/to/the/working/directory

  To validate a single page, run:

    cecil.phar doctor:frontmatter --page=blog/post.md

  To inspect a site with an extra configuration file, run:

    cecil.phar doctor:frontmatter --config=config.yml</code></pre>
<h2 id="doctor-seo">doctor:seo<a class="heading-anchor" href="#doctor-seo" aria-hidden="true" tabindex="-1"></a></h2>
<p>Audits rendered HTML pages for common SEO issues.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Audits rendered HTML pages for common SEO issues

Usage:
  doctor:seo [options] [--] [&lt;path&gt;]

Arguments:
  path                     Use the given path as working directory

Options:
  -c, --config=CONFIG      Set the path to an extra configuration file
  -p, --page=PAGE          Audit a single page relative to the pages directory
      --format=FORMAT      Output format: text (default) or json [default: "text"]
      --include-generated  Include generated pages (sections, taxonomies, pagination, etc.) in audit
      --feedback           Include findings with feedback level
      --fail-on=FAIL-ON    Return a failure exit code when findings of this level or higher are found: bad (default), ok, feedback or never [default: "bad"]
  -h, --help               Display help for the given command. When no command is given display help for the list command
      --silent             Do not output any message
  -q, --quiet              Only errors are displayed. All other output is suppressed
  -V, --version            Display this application version
      --ansi|--no-ansi     Force (or disable --no-ansi) ANSI output
  -n, --no-interaction     Do not ask any interactive question
  -v|vv|vvv, --verbose     Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The doctor:seo command builds the site in dry-run mode, then audits
  the rendered HTML output for a focused set of SEO checks.

    cecil.phar doctor:seo
    cecil.phar doctor:seo path/to/the/working/directory

  To audit a single page, run:

    cecil.phar doctor:seo --page=blog/post.md

  To output results as JSON for CI integration:

    cecil.phar doctor:seo --format=json

  To include generated pages (sections, taxonomies, pagination, etc.):

    cecil.phar doctor:seo --include-generated

  To include findings with feedback level:

    cecil.phar doctor:seo --feedback

  By default, the command fails if findings with the bad level are found.
  To change this behavior, use the --fail-on option:

    cecil.phar doctor:seo --fail-on=ok
    cecil.phar doctor:seo --fail-on=never

  To inspect a site with an extra configuration file, run:

    cecil.phar doctor:seo --config=config.yml

  Configure audit thresholds and checks in your configuration:

    doctor:
      seo:
        title: { min: 30, max: 60 }
        description: { min: 120, max: 160 }
        content: { min_words: 300 }
        checks:
          title: true
          description: true
          canonical: true
          h1: true
          og_tags: true
          img_alt: true
          content_length: true
          lang_attribute: true</code></pre>
<p>The command builds the site in dry-run mode, then audits the rendered HTML output for a focused set of checks: title tag, meta description, canonical URL, heading structure, Open Graph tags, image alt attributes, estimated content length and <code translate="no">lang</code> attribute of the <code translate="no">&lt;html&gt;</code> element.</p>
<p>By default, generated pages (pages without content file: sections, taxonomies, pagination, etc.) are excluded from the audit. Use <code translate="no">--include-generated</code> to include them.</p>
<p>By default, findings with level <code translate="no">feedback</code> are not listed.</p>
<p>Use <code translate="no">--feedback</code> to include findings with level <code translate="no">feedback</code> in addition to other findings.</p>
<p>Output results as JSON for CI integration using <code translate="no">--format=json</code>.</p>
<p>By default, the command returns a failure exit code (<code translate="no">1</code>) when findings with level <code translate="no">bad</code> are found. Use <code translate="no">--fail-on=ok</code> to also fail on <code translate="no">ok</code> findings, <code translate="no">--fail-on=feedback</code> to fail on any finding, or <code translate="no">--fail-on=never</code> to always succeed.</p>
<h3 id="configuration">Configuration<a class="heading-anchor" href="#configuration" aria-hidden="true" tabindex="-1"></a></h3>
<p>Customize audit thresholds and enabled checks in your configuration file:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">doctor:</span>
  <span class="hljs-attr">seo:</span>
    <span class="hljs-attr">title:</span> <span class="hljs-string">{</span> <span class="hljs-attr">min:</span> <span class="hljs-number">30</span><span class="hljs-string">,</span> <span class="hljs-attr">max:</span> <span class="hljs-number">60</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">description:</span> <span class="hljs-string">{</span> <span class="hljs-attr">min:</span> <span class="hljs-number">120</span><span class="hljs-string">,</span> <span class="hljs-attr">max:</span> <span class="hljs-number">160</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">content:</span> <span class="hljs-string">{</span> <span class="hljs-attr">min_words:</span> <span class="hljs-number">300</span> <span class="hljs-string">}</span>
    <span class="hljs-attr">checks:</span>
      <span class="hljs-attr">title:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">description:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">h1:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">og_tags:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">img_alt:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">content_length:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">lang_attribute:</span> <span class="hljs-literal">true</span></code></pre>
<h2 id="doctor-links">doctor:links<a class="heading-anchor" href="#doctor-links" aria-hidden="true" tabindex="-1"></a></h2>
<p>Checks internal and external links of the rendered pages.</p>
<pre data-lang="plaintext"><code class="language-plaintext hljs plaintext" translate="no">Description:
  Checks internal and external links of the rendered pages

Usage:
  doctor:links [options] [--] [&lt;path&gt;]

Arguments:
  path                           Use the given path as working directory

Options:
  -c, --config=CONFIG            Set the path to an extra configuration file
  -p, --page=PAGE                Check links of a single page relative to the pages directory
      --internal                 Check internal links
      --external                 Check external links
      --exclude=EXCLUDE          Exclude links matching this regular expression (multiple values allowed)
      --timeout=TIMEOUT          External links request timeout, in seconds
      --concurrency=CONCURRENCY  Number of concurrent external links requests
      --no-cache                 Do not use cached external links results
      --format=FORMAT            Output format: text (default) or json [default: "text"]
      --include-generated        Include generated pages (sections, taxonomies, pagination, etc.) in audit
      --feedback                 Include findings with feedback level
      --fail-on=FAIL-ON          Return a failure exit code when findings of this level or higher are found: bad (default), ok, feedback or never [default: "bad"]
  -h, --help                     Display help for the given command. When no command is given display help for the list command
      --silent                   Do not output any message
  -q, --quiet                    Only errors are displayed. All other output is suppressed
  -V, --version                  Display this application version
      --ansi|--no-ansi           Force (or disable --no-ansi) ANSI output
  -n, --no-interaction           Do not ask any interactive question
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The doctor:links command builds the site in dry-run mode, then checks the links
  found in the rendered HTML pages (links, images, scripts, stylesheets, media, inline
  styles) and in the linked CSS files (url() and @import).

    cecil.phar doctor:links
    cecil.phar doctor:links path/to/the/working/directory

  By default, only internal links are checked. To check external links too, run:

    cecil.phar doctor:links --internal --external

  To check external links only, run:

    cecil.phar doctor:links --external

  To check links of a single page, run:

    cecil.phar doctor:links --page=blog/post.md

  To exclude links matching a regular expression, run:

    cecil.phar doctor:links --external --exclude="linkedin\.com" --exclude="^https://localhost"

  To output results as JSON for CI integration:

    cecil.phar doctor:links --format=json

  By default, the command fails if findings with the bad level are found.
  To change this behavior, use the --fail-on option:

    cecil.phar doctor:links --fail-on=ok
    cecil.phar doctor:links --fail-on=never

  Configure default settings in your configuration:

    doctor:
      links:
        internal: true
        external: false
        timeout: 10
        concurrency: 10
        cache_ttl: 86400
        exclude: ['linkedin\.com']</code></pre>
<p>The command builds the site in dry-run mode, then checks the links found in the rendered HTML pages: links (<code translate="no">&lt;a&gt;</code>, <code translate="no">&lt;area&gt;</code>, <code translate="no">&lt;link&gt;</code>), images (<code translate="no">src</code> and <code translate="no">srcset</code>), scripts, iframes, media and inline styles. CSS files linked from the pages are also analyzed (<code translate="no">url()</code> and <code translate="no">@import</code>).</p>
<ul>
<li><strong>Internal links</strong> must target a page of the site, a static file or an asset. Fragments (<code translate="no">#anchor</code>) must match an element ID of the target page. Absolute URLs starting with <code translate="no">baseurl</code> are considered internal links.</li>
<li><strong>External links</strong> are requested over HTTP (<code translate="no">HEAD</code>, then <code translate="no">GET</code> if the server refuses <code translate="no">HEAD</code>), concurrently. Successful results are cached (24 hours by default): use <code translate="no">--no-cache</code> to check them again.</li>
</ul>
<p>By default, only internal links are checked:</p>
<pre data-lang="bash"><code class="language-bash hljs bash" translate="no">php cecil.phar doctor:links                       <span class="hljs-comment"># internal links (default)</span>
php cecil.phar doctor:links --external            <span class="hljs-comment"># external links only</span>
php cecil.phar doctor:links --internal --external <span class="hljs-comment"># both</span></code></pre>
<p>Finding levels:</p>
<table>
<thead>
<tr>
<th>Level</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td><code translate="no">bad</code></td>
<td>Broken link: target not found, missing anchor, HTTP error (4xx, 5xx), unresolved host, etc.</td>
</tr>
<tr>
<td><code translate="no">ok</code></td>
<td>Working link that could be improved: redirection, missing trailing slash</td>
</tr>
<tr>
<td><code translate="no">feedback</code></td>
<td>Unverifiable link: access denied (401, 403, 429, 999), probably due to bot protection, or timeout</td>
</tr>
</tbody>
</table>
<p>Links using schemes other than HTTP(S) (e.g. <code translate="no">mailto:</code>, <code translate="no">tel:</code>, <code translate="no">data:</code>) are ignored. Use <code translate="no">--exclude</code> (regular expression, case-insensitive) to ignore other links.</p>
<p>The <code translate="no">--page</code>, <code translate="no">--include-generated</code>, <code translate="no">--feedback</code>, <code translate="no">--format</code> and <code translate="no">--fail-on</code> options behave as with <code translate="no">doctor:seo</code> (see above).</p>
<aside class="note note-info"><p>Checking external links requires the PHP cURL extension.</p></aside>
<h3 id="configuration-1">Configuration<a class="heading-anchor" href="#configuration-1" aria-hidden="true" tabindex="-1"></a></h3>
<p>Customize default settings in your configuration file:</p>
<pre data-lang="yaml"><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">doctor:</span>
  <span class="hljs-attr">links:</span>
    <span class="hljs-attr">internal:</span> <span class="hljs-literal">true</span>    <span class="hljs-comment"># check internal links</span>
    <span class="hljs-attr">external:</span> <span class="hljs-literal">false</span>   <span class="hljs-comment"># check external links</span>
    <span class="hljs-attr">timeout:</span> <span class="hljs-number">10</span>       <span class="hljs-comment"># external links request timeout, in seconds</span>
    <span class="hljs-attr">concurrency:</span> <span class="hljs-number">10</span>   <span class="hljs-comment"># number of concurrent external links requests</span>
    <span class="hljs-attr">cache_ttl:</span> <span class="hljs-number">86400</span>  <span class="hljs-comment"># external links successful results cache TTL, in seconds</span>
    <span class="hljs-attr">exclude:</span> <span class="hljs-string">[]</span>       <span class="hljs-comment"># links to ignore (list of regular expressions), e.g. ['linkedin\.com', '^https://localhost']</span>
    <span class="hljs-attr">useragent:</span> <span class="hljs-string">~</span>      <span class="hljs-comment"># User-Agent header of external links requests (`assets.remote.useragent.default` by default)</span></code></pre>]]>
    </content>
  </entry>
</feed>
