{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Cecil - Comment faire ?",
  "home_page_url": "https://cloudflare.cecil.app/fr/comment-faire/",
  "feed_url": "https://cloudflare.cecil.app/fr/comment-faire/feed.json",
  "description": "Articles et tutoriels pour réaliser les tâches courantes avec Cecil.",
  "icon": "https://cloudflare.cecil.app/favicon.7ff4b89eec6dad139a7d2d6561543285.png",
  "favicon": "https://cloudflare.cecil.app/thumbnails/64x/favicon.7ff4b89eec6dad139a7d2d6561543285.png",
  "language": "fr",
  "items": [
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/extension-generateur-de-pages/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/extension-generateur-de-pages/",
      "title": "Créer un générateur de pages personnalisé",
      "summary": "Créer des pages Cecil à partir d’une API, d’une base de données ou de toute autre source avec un générateur de pages personnalisé.",
      "date_published": "2026-10-22T00:00:00+00:00",
      "date_modified": "2026-10-26T00:00:00+00:00","content_text": "Un générateur de pages crée des pages sans fichier Markdown (par exemple à partir d’une API ou d’une base de données), ou modifie des pages existantes. Cecil utilise ses propres générateurs pour construire les sections, les taxonomies, la pagination, etc., et vous pouvez ajouter les vôtres.\nCréer la classe du générateur\nAjoutez une classe PHP dans le répertoire extensions de votre site, avec votre propre namespace (ex. : MySite\\Generator, le namespace Cecil\\ étant réservé). Elle étend AbstractGenerator, implémente GeneratorInterface et ajoute des pages à $this-&gt;generatedPages dans la méthode generate().\nLa commande new:extension crée le squelette de la classe et affiche la configuration permettant de l’activer : php cecil.phar new:extension --type=generator --name=Posts --namespace=MySite.\nL’exemple suivant crée une page pour chaque élément renvoyé par une API JSON :\nextensions\/MySite\/Generator\/Posts.php\n&lt;?php\nnamespace MySite\\Generator;\n\nuse Cecil\\Collection\\Page\\Page;\nuse Cecil\\Collection\\Page\\Type;\nuse Cecil\\Generator\\AbstractGenerator;\nuse Cecil\\Generator\\GeneratorInterface;\n\nclass Posts extends AbstractGenerator implements GeneratorInterface\n{\n    public function generate(): void\n    {\n        $posts = json_decode(file_get_contents('https:\/\/jsonplaceholder.typicode.com\/posts'), true) ?? [];\n\n        foreach ($posts as $post) {\n            $page = (new Page(\"posts\/{$post['id']}\"))\n                -&gt;setType(Type::PAGE)\n                -&gt;setPath(\"posts\/{$post['id']}\")\n                -&gt;setSection('posts')\n                -&gt;setBodyHtml('&lt;p&gt;' . htmlspecialchars($post['body']) . '&lt;\/p&gt;')\n                -&gt;setVariable('title', $post['title']);\n            $this-&gt;generatedPages-&gt;add($page);\n        }\n    }\n}\nLes pages existantes (issues des fichiers Markdown et des générateurs précédents) sont accessibles via $this-&gt;builder-&gt;getPages(), et la configuration via $this-&gt;config.\nDéclarer le générateur\nAjoutez le nom de la classe à la liste pages.generators dans cecil.yml, indexée par un nom, avec sa priorité :\npages:\n  generators:\n    Posts: { class: MySite\\Generator\\Posts, priority: 35 }\nLes générateurs sont exécutés par ordre de priorité croissant. Ceux fournis par Cecil utilisent les priorités 10 (DefaultPages) à 90 (Redirect) : avec 35, les pages sont créées avant les sections (40) et, grâce à setSection(), sont donc regroupées dans la section posts, comme les pages issues de fichiers Markdown.\nSans setSection(), les pages créées par un générateur n’appartiennent à aucune section. Comme toute autre page, elles sont listées dans site.pages.showable et dans le sitemap : définissez la variable excluded à true pour retirer une page des listes.\nGénérer le site\nphp cecil.phar build\nLes pages sont désormais disponibles aux adresses \/posts\/1\/, \/posts\/2\/, etc., rendues avec les templates page par défaut.\nConsultez la documentation des générateurs de pages pour un autre exemple, basé sur une base de données SQLite.",
      "content_html": "<p>Un générateur de pages crée des pages sans fichier Markdown (par exemple à partir d’une API ou d’une base de données), ou modifie des pages existantes. Cecil utilise ses propres générateurs pour construire les sections, les taxonomies, la pagination, etc., et vous pouvez ajouter les vôtres.</p>\n<h2 id=\"creer-la-classe-du-generateur\">Créer la classe du générateur<a class=\"heading-anchor\" href=\"#creer-la-classe-du-generateur\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez une classe PHP dans le répertoire <code translate=\"no\">extensions</code> de votre site, avec votre propre namespace (ex. : <code translate=\"no\">MySite\\Generator</code>, le namespace <code translate=\"no\">Cecil\\</code> étant réservé). Elle étend <code translate=\"no\">AbstractGenerator</code>, implémente <code translate=\"no\">GeneratorInterface</code> et ajoute des pages à <code translate=\"no\">$this-&gt;generatedPages</code> dans la méthode <code translate=\"no\">generate()</code>.</p>\n<aside class=\"note note-tip\"><p>La commande <a href=\"https://cloudflare.cecil.app/fr/documentation/commandes/new-extension/\"><code translate=\"no\">new:extension</code></a> crée le squelette de la classe et affiche la configuration permettant de l’activer : <code translate=\"no\">php cecil.phar new:extension --type=generator --name=Posts --namespace=MySite</code>.</p></aside>\n<p>L’exemple suivant crée une page pour chaque élément renvoyé par une API JSON :</p>\n<p><em>extensions/MySite/Generator/Posts.php</em></p>\n<pre data-lang=\"php\"><code class=\"language-php hljs php\" translate=\"no\"><span class=\"hljs-meta\">&lt;?php</span>\n<span class=\"hljs-keyword\">namespace</span> <span class=\"hljs-title\">MySite</span>\\<span class=\"hljs-title\">Generator</span>;\n\n<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>;\n<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>;\n<span class=\"hljs-keyword\">use</span> <span class=\"hljs-title\">Cecil</span>\\<span class=\"hljs-title\">Generator</span>\\<span class=\"hljs-title\">AbstractGenerator</span>;\n<span class=\"hljs-keyword\">use</span> <span class=\"hljs-title\">Cecil</span>\\<span class=\"hljs-title\">Generator</span>\\<span class=\"hljs-title\">GeneratorInterface</span>;\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class</span> <span class=\"hljs-title\">Posts</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>\n</span>{\n    <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>\n    </span>{\n        $posts = json_decode(file_get_contents(<span class=\"hljs-string\">'https://jsonplaceholder.typicode.com/posts'</span>), <span class=\"hljs-keyword\">true</span>) ?? [];\n\n        <span class=\"hljs-keyword\">foreach</span> ($posts <span class=\"hljs-keyword\">as</span> $post) {\n            $page = (<span class=\"hljs-keyword\">new</span> Page(<span class=\"hljs-string\">\"posts/{$post['id']}\"</span>))\n                -&gt;setType(Type::PAGE)\n                -&gt;setPath(<span class=\"hljs-string\">\"posts/{$post['id']}\"</span>)\n                -&gt;setSection(<span class=\"hljs-string\">'posts'</span>)\n                -&gt;setBodyHtml(<span class=\"hljs-string\">'&lt;p&gt;'</span> . htmlspecialchars($post[<span class=\"hljs-string\">'body'</span>]) . <span class=\"hljs-string\">'&lt;/p&gt;'</span>)\n                -&gt;setVariable(<span class=\"hljs-string\">'title'</span>, $post[<span class=\"hljs-string\">'title'</span>]);\n            <span class=\"hljs-keyword\">$this</span>-&gt;generatedPages-&gt;add($page);\n        }\n    }\n}</code></pre>\n<aside class=\"note note-tip\"><p>Les pages existantes (issues des fichiers Markdown et des générateurs précédents) sont accessibles via <code translate=\"no\">$this-&gt;builder-&gt;getPages()</code>, et la configuration via <code translate=\"no\">$this-&gt;config</code>.</p></aside>\n<h2 id=\"declarer-le-generateur\">Déclarer le générateur<a class=\"heading-anchor\" href=\"#declarer-le-generateur\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez le nom de la classe à la liste <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-generators\"><code translate=\"no\">pages.generators</code></a> dans <code translate=\"no\">cecil.yml</code>, indexée par un nom, avec sa priorité :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">generators:</span>\n    <span class=\"hljs-attr\">Posts:</span> <span class=\"hljs-string\">{</span> <span class=\"hljs-attr\">class:</span> <span class=\"hljs-string\">MySite\\Generator\\Posts,</span> <span class=\"hljs-attr\">priority:</span> <span class=\"hljs-number\">35</span> <span class=\"hljs-string\">}</span></code></pre>\n<p>Les générateurs sont exécutés par ordre de priorité croissant. Ceux fournis par Cecil utilisent les priorités <code translate=\"no\">10</code> (<code translate=\"no\">DefaultPages</code>) à <code translate=\"no\">90</code> (<code translate=\"no\">Redirect</code>) : avec <code translate=\"no\">35</code>, les pages sont créées avant les sections (<code translate=\"no\">40</code>) et, grâce à <code translate=\"no\">setSection()</code>, sont donc regroupées dans la section <code translate=\"no\">posts</code>, comme les pages issues de fichiers Markdown.</p>\n<aside class=\"note note-info\"><p>Sans <code translate=\"no\">setSection()</code>, les pages créées par un générateur n’appartiennent à aucune section. Comme toute autre page, elles sont listées dans <code translate=\"no\">site.pages.showable</code> et dans le sitemap : définissez la variable <code translate=\"no\">excluded</code> à <code translate=\"no\">true</code> pour retirer une page des listes.</p></aside>\n<h2 id=\"generer-le-site\">Générer le site<a class=\"heading-anchor\" href=\"#generer-le-site\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar build</code></pre>\n<p>Les pages sont désormais disponibles aux adresses <code translate=\"no\">/posts/1/</code>, <code translate=\"no\">/posts/2/</code>, etc., rendues avec les templates <code translate=\"no\">page</code> par défaut.</p>\n<aside class=\"note note-info\"><p>Consultez la <a href=\"https://cloudflare.cecil.app/fr/documentation/developpeurs/etendre/#generateurs-de-pages\">documentation des générateurs de pages</a> pour un autre exemple, basé sur une base de données SQLite.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/extension-twig/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/extension-twig/",
      "title": "Ajouter une fonction ou un filtre Twig personnalisé",
      "summary": "Étendre les templates de Cecil avec vos propres fonctions et filtres Twig grâce à une extension Twig.",
      "date_published": "2026-10-21T00:00:00+00:00",
      "date_modified": "2026-10-26T00:00:00+00:00","content_text": "Cecil fournit de nombreuses fonctions et de nombreux filtres de template, mais vous pouvez ajouter les vôtres avec une extension Twig écrite en PHP.\nCréer la classe de l’extension\nAjoutez un fichier PHP dans le répertoire extensions de votre site, avec votre propre namespace (ex. : MySite\\Twig, le namespace Cecil\\ étant réservé), le chemin du fichier correspondant au namespace :\nextensions\/MySite\/Twig\/MyTwigExtension.php\n&lt;?php\nnamespace MySite\\Twig;\n\nclass MyTwigExtension extends \\Twig\\Extension\\AbstractExtension\n{\n    public function getFilters(): array\n    {\n        return [\n            \/\/ {{ 'text'|md5 }}\n            new \\Twig\\TwigFilter('md5', 'md5'),\n            \/\/ {{ page.content|word_count }}\n            new \\Twig\\TwigFilter('word_count', [$this, 'wordCount']),\n        ];\n    }\n\n    public function getFunctions(): array\n    {\n        return [\n            \/\/ {{ year() }}\n            new \\Twig\\TwigFunction('year', fn () =&gt; date('Y')),\n        ];\n    }\n\n    public function wordCount(string $html): int\n    {\n        return str_word_count(strip_tags($html));\n    }\n}\nLa commande new:extension crée le squelette de la classe : php cecil.phar new:extension --type=twig --name=MyTwigExtension --namespace=MySite.\nDéclarer l’extension\nAjoutez le nom de la classe à la liste layouts.extensions dans cecil.yml, indexée par un nom de votre choix :\nlayouts:\n  extensions:\n    MyExtension: MySite\\Twig\\MyTwigExtension\nL’utiliser dans les templates\n&lt;p&gt;{{ page.content|word_count }} words&lt;\/p&gt;\n&lt;footer&gt;© {{ year() }} {{ site.title }}&lt;\/footer&gt;\nLancez la génération avec l’option -vvv pour vérifier que l’extension est chargée : Cecil affiche Extension \"MyExtension\" (layouts.extensions) loaded, ou une erreur si la classe ne peut pas être chargée. Consultez la documentation des extensions Twig.",
      "content_html": "<p>Cecil fournit de nombreuses <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/fonctions/\">fonctions</a> et de nombreux <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/filtres/\">filtres</a> de template, mais vous pouvez ajouter les vôtres avec une <a href=\"https://twig.symfony.com/doc/advanced.html#creating-an-extension\" target=\"_blank\" rel=\"noopener noreferrer\">extension Twig</a> écrite en PHP.</p>\n<h2 id=\"creer-la-classe-de-l-extension\">Créer la classe de l’extension<a class=\"heading-anchor\" href=\"#creer-la-classe-de-l-extension\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez un fichier PHP dans le répertoire <code translate=\"no\">extensions</code> de votre site, avec votre propre namespace (ex. : <code translate=\"no\">MySite\\Twig</code>, le namespace <code translate=\"no\">Cecil\\</code> étant réservé), le chemin du fichier correspondant au namespace :</p>\n<p><em>extensions/MySite/Twig/MyTwigExtension.php</em></p>\n<pre data-lang=\"php\"><code class=\"language-php hljs php\" translate=\"no\"><span class=\"hljs-meta\">&lt;?php</span>\n<span class=\"hljs-keyword\">namespace</span> <span class=\"hljs-title\">MySite</span>\\<span class=\"hljs-title\">Twig</span>;\n\n<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>\n</span>{\n    <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>\n    </span>{\n        <span class=\"hljs-keyword\">return</span> [\n            <span class=\"hljs-comment\">// {{ 'text'|md5 }}</span>\n            <span class=\"hljs-keyword\">new</span> \\Twig\\TwigFilter(<span class=\"hljs-string\">'md5'</span>, <span class=\"hljs-string\">'md5'</span>),\n            <span class=\"hljs-comment\">// {{ page.content|word_count }}</span>\n            <span class=\"hljs-keyword\">new</span> \\Twig\\TwigFilter(<span class=\"hljs-string\">'word_count'</span>, [<span class=\"hljs-keyword\">$this</span>, <span class=\"hljs-string\">'wordCount'</span>]),\n        ];\n    }\n\n    <span class=\"hljs-keyword\">public</span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span> <span class=\"hljs-title\">getFunctions</span><span class=\"hljs-params\">()</span>: <span class=\"hljs-title\">array</span>\n    </span>{\n        <span class=\"hljs-keyword\">return</span> [\n            <span class=\"hljs-comment\">// {{ year() }}</span>\n            <span class=\"hljs-keyword\">new</span> \\Twig\\TwigFunction(<span class=\"hljs-string\">'year'</span>, fn () =&gt; date(<span class=\"hljs-string\">'Y'</span>)),\n        ];\n    }\n\n    <span class=\"hljs-keyword\">public</span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span> <span class=\"hljs-title\">wordCount</span><span class=\"hljs-params\">(string $html)</span>: <span class=\"hljs-title\">int</span>\n    </span>{\n        <span class=\"hljs-keyword\">return</span> str_word_count(strip_tags($html));\n    }\n}</code></pre>\n<aside class=\"note note-tip\"><p>La commande <a href=\"https://cloudflare.cecil.app/fr/documentation/commandes/new-extension/\"><code translate=\"no\">new:extension</code></a> crée le squelette de la classe : <code translate=\"no\">php cecil.phar new:extension --type=twig --name=MyTwigExtension --namespace=MySite</code>.</p></aside>\n<h2 id=\"declarer-l-extension\">Déclarer l’extension<a class=\"heading-anchor\" href=\"#declarer-l-extension\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez le nom de la classe à la liste <code translate=\"no\">layouts.extensions</code> dans <code translate=\"no\">cecil.yml</code>, indexée par un nom de votre choix :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">layouts:</span>\n  <span class=\"hljs-attr\">extensions:</span>\n    <span class=\"hljs-attr\">MyExtension:</span> <span class=\"hljs-string\">MySite\\Twig\\MyTwigExtension</span></code></pre>\n<h2 id=\"l-utiliser-dans-les-templates\">L’utiliser dans les templates<a class=\"heading-anchor\" href=\"#l-utiliser-dans-les-templates\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ page.content|word_count }}</span><span class=\"xml\"> words<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">p</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">footer</span>&gt;</span>© </span><span class=\"hljs-template-variable\">{{ year() }}</span><span class=\"xml\"> </span><span class=\"hljs-template-variable\">{{ site.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">footer</span>&gt;</span></span></code></pre>\n<aside class=\"note note-tip\"><p>Lancez la génération avec l’option <code translate=\"no\">-vvv</code> pour vérifier que l’extension est chargée : Cecil affiche <code translate=\"no\">Extension \"MyExtension\" (layouts.extensions) loaded</code>, ou une erreur si la classe ne peut pas être chargée. Consultez la <a href=\"https://cloudflare.cecil.app/fr/documentation/developpeurs/etendre/#extension-twig\">documentation des extensions Twig</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-cache-fragments/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-cache-fragments/",
      "title": "Accélérer les builds avec le cache de fragments",
      "summary": "Mettre en cache des parties des templates Cecil pour éviter de générer le même contenu pour chaque page.",
      "date_published": "2026-10-20T00:00:00+00:00","content_text": "Certaines parties d’un layout (pied de page, barre latérale, liste des derniers articles, etc.) sont identiques sur toutes les pages, mais sont pourtant régénérées pour chacune d’elles. Avec le cache de fragments, Cecil génère ces parties une seule fois par build et par langue, puis réutilise le résultat pour les autres pages.\nEnvelopper le contenu avec la balise cache\nEntourez la partie à mettre en cache avec la balise cache et une clé construite avec la fonction cache_key :\n{% cache cache_key('footer') %}\n  &lt;footer&gt;\n    {% for entry in site.menus.footer|sort_by_weight %}\n      &lt;a href=\"{{ url(entry.url) }}\"&gt;{{ entry.name }}&lt;\/a&gt;\n    {% endfor %}\n  &lt;\/footer&gt;\n{% endcache %}\nConstruire la clé de cache\nLa fonction cache_key construit une clé à partir d’un nom, d’une valeur facultative, de la langue courante et de l’ID du build :\n{% cache cache_key('sidebar', page.section) %}\n  {# contenu à mettre en cache #}\n{% endcache %}\n\nla langue garantit que chaque langue dispose de son propre fragment\nl’ID du build change à chaque build : un fragment est donc généré une fois par build et n’est jamais réutilisé par un build suivant\nla valeur facultative (chaîne, tableau ou objet) est hachée et ajoutée à la clé, pour conserver plusieurs variantes d’un même fragment, par exemple une par section\n\nLe cache de fragments est stocké sur disque et n’expire pas. Avec une clé fixe comme {% cache 'footer' %}, le fragment est partagé par toutes les langues et réutilisé par les builds suivants : les pages peuvent alors afficher un contenu obsolète ou dans la mauvaise langue jusqu’à ce que le cache soit vidé. Utilisez toujours cache_key.\nExemple : barre latérale des derniers articles\nLa liste ci-dessous est générée une seule fois par build et par langue, puis réutilisée par chaque page qui l’inclut :\n{% cache cache_key('latest-posts') %}\n  &lt;aside&gt;\n    &lt;h2&gt;Latest posts&lt;\/h2&gt;\n    &lt;ul&gt;\n    {% for post in site.pages.showable|filter_by('section', 'blog')|sort_by_date|slice(0, 5) %}\n      &lt;li&gt;&lt;a href=\"{{ url(post) }}\"&gt;{{ post.title }}&lt;\/a&gt;&lt;\/li&gt;\n    {% endfor %}\n    &lt;\/ul&gt;\n  &lt;\/aside&gt;\n{% endcache %}\nNe mettez pas en cache un contenu qui dépend de la page courante (ex. : élément actif du menu, titre de la page), ou incluez une valeur de la page (comme page.id) dans la clé.\nVider le cache\nVider uniquement le cache des fragments :\nphp cecil.phar cache:clear:templates --fragments\nOu vider tout le cache des templates, ou tous les caches :\nphp cecil.phar cache:clear:templates\nphp cecil.phar cache:clear\nPendant le développement local, vous pouvez aussi vider le cache avant chaque build :\nphp cecil.phar serve --clear-cache\nConsultez la documentation du cache de fragments, de la fonction cache_key et de la configuration du cache.",
      "content_html": "<p>Certaines parties d’un layout (pied de page, barre latérale, liste des derniers articles, etc.) sont identiques sur toutes les pages, mais sont pourtant régénérées pour chacune d’elles. Avec le cache de <em>fragments</em>, Cecil génère ces parties une seule fois par build et par langue, puis réutilise le résultat pour les autres pages.</p>\n<h2 id=\"envelopper-le-contenu-avec-la-balise-cache\">Envelopper le contenu avec la balise cache<a class=\"heading-anchor\" href=\"#envelopper-le-contenu-avec-la-balise-cache\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Entourez la partie à mettre en cache avec la <a href=\"https://twig.symfony.com/doc/tags/cache.html\" target=\"_blank\" rel=\"noopener noreferrer\">balise <code translate=\"no\">cache</code></a> et une clé construite avec la fonction <code translate=\"no\">cache_key</code> :</p>\n<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('footer') %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">footer</span>&gt;</span>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> entry in site.menus.footer|sort_by_weight %}</span><span class=\"xml\">\n      <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>&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>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">footer</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endcache</span> %}</span></code></pre>\n<h2 id=\"construire-la-cle-de-cache\">Construire la clé de cache<a class=\"heading-anchor\" href=\"#construire-la-cle-de-cache\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La fonction <code translate=\"no\">cache_key</code> construit une clé à partir d’un nom, d’une valeur facultative, de la langue courante et de l’ID du build :</p>\n<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('sidebar', page.section) %}</span><span class=\"xml\">\n  </span><span class=\"hljs-comment\">{# contenu à mettre en cache #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endcache</span> %}</span></code></pre>\n<ul>\n<li>la langue garantit que chaque langue dispose de son propre fragment</li>\n<li>l’ID du build change à chaque build : un fragment est donc généré une fois par build et n’est jamais réutilisé par un build suivant</li>\n<li>la valeur facultative (chaîne, tableau ou objet) est hachée et ajoutée à la clé, pour conserver plusieurs variantes d’un même fragment, par exemple une par section</li>\n</ul>\n<aside class=\"note note-warning\"><p>Le cache de <em>fragments</em> est stocké sur disque et n’expire pas. Avec une clé fixe comme <code translate=\"no\">{% cache 'footer' %}</code>, le fragment est partagé par toutes les langues et réutilisé par les builds suivants : les pages peuvent alors afficher un contenu obsolète ou dans la mauvaise langue jusqu’à ce que le cache soit vidé. Utilisez toujours <code translate=\"no\">cache_key</code>.</p></aside>\n<h2 id=\"exemple-barre-laterale-des-derniers-articles\">Exemple : barre latérale des derniers articles<a class=\"heading-anchor\" href=\"#exemple-barre-laterale-des-derniers-articles\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La liste ci-dessous est générée une seule fois par build et par langue, puis réutilisée par chaque page qui l’inclut :</p>\n<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('latest-posts') %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">aside</span>&gt;</span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2</span>&gt;</span>Latest posts<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">h2</span>&gt;</span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul</span>&gt;</span>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> post in site.pages.showable|filter_by('section', 'blog')|sort_by_date|<span class=\"hljs-keyword\">slice</span>(0, 5) %}</span><span class=\"xml\">\n      <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\">li</span>&gt;</span>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span><span class=\"xml\">\n    <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">ul</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">aside</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endcache</span> %}</span></code></pre>\n<aside class=\"note note-warning\"><p>Ne mettez pas en cache un contenu qui dépend de la page courante (ex. : élément actif du menu, titre de la page), ou incluez une valeur de la page (comme <code translate=\"no\">page.id</code>) dans la clé.</p></aside>\n<h2 id=\"vider-le-cache\">Vider le cache<a class=\"heading-anchor\" href=\"#vider-le-cache\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Vider uniquement le cache des fragments :</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar cache:clear:templates --fragments</code></pre>\n<p>Ou vider tout le cache des templates, ou tous les caches :</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar cache:clear:templates\nphp cecil.phar cache:clear</code></pre>\n<p>Pendant le développement local, vous pouvez aussi vider le cache avant chaque build :</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar serve --clear-cache</code></pre>\n<aside class=\"note note-info\"><p>Consultez la documentation du <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/cache/#cache-de-fragments\">cache de fragments</a>, de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/fonctions/#cache-key\">fonction <code translate=\"no\">cache_key</code></a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/cache/\">configuration du cache</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/contenu-fichiers-de-donnees/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/contenu-fichiers-de-donnees/",
      "title": "Générer des pages à partir de fichiers de données",
      "summary": "Utiliser des fichiers de données YAML, JSON, CSV ou XML pour construire des pages Cecil sans écrire de Markdown pour chaque élément.",
      "date_published": "2026-10-19T00:00:00+00:00",
      "date_modified": "2026-10-26T00:00:00+00:00","content_text": "Les fichiers de données sont un moyen pratique de gérer du contenu structuré (membres d’une équipe, produits, événements, etc.) en dehors des pages, puis de l’afficher avec les templates.\nAjouter un fichier de données\nStockez vos fichiers dans le dossier data. Les formats pris en charge sont YAML, JSON, XML et CSV.\n# data\/team.yml\n- name: Ada\n  role: Developer\n- name: Grace\n  role: Designer\nUne version localisée peut être ajoutée avec un suffixe de langue (par exemple data\/team.fr.yml) : elle est utilisée pour les pages dans cette langue.\nDès qu’une langue possède au moins un fichier de données localisé, site.data ne contient plus que les fichiers localisés de cette langue : les fichiers non localisés ne sont alors plus disponibles pour ses pages.\nAfficher les données dans un template\nLe fichier est disponible dans les templates via site.data.&lt;nom du fichier&gt;, par exemple layouts\/team.html.twig :\n{% extends 'page.html.twig' %}\n\n{% block content %}\n  &lt;h1&gt;{{ page.title }}&lt;\/h1&gt;\n  &lt;ul&gt;\n  {% for member in site.data.team %}\n    &lt;li&gt;{{ member.name }}, {{ member.role }}&lt;\/li&gt;\n  {% endfor %}\n  &lt;\/ul&gt;\n{% endblock %}\nLes fichiers des sous-dossiers sont imbriqués : data\/galleries\/gallery-1.json est disponible via site.data.galleries['gallery-1'].\nCréer la page\nLa page qui utilise ce template n’a besoin d’aucun contenu : déclarez-la comme page par défaut dans cecil.yml, indexée par ID :\npages:\n  default:\n    team:\n      path: team\n      title: Our team\n      layout: team\nVous pouvez aussi créer un fichier pages\/team.md avec layout: team dans son front matter.\nGénérer une page par élément\nPour générer une page par entrée, créez un générateur de pages. Les données chargées depuis les fichiers de données sont disponibles via $this-&gt;builder-&gt;getData() :\n&lt;?php\n\/\/ extensions\/MySite\/Generator\/Team.php\nnamespace MySite\\Generator;\n\nuse Cecil\\Collection\\Page\\Page;\nuse Cecil\\Collection\\Page\\Type;\nuse Cecil\\Generator\\AbstractGenerator;\nuse Cecil\\Generator\\GeneratorInterface;\nuse Cecil\\Util\\Slugifier;\n\nclass Team extends AbstractGenerator implements GeneratorInterface\n{\n    public function generate(): void\n    {\n        $data = $this-&gt;builder-&gt;getData($this-&gt;config-&gt;getLanguageDefault());\n        foreach ($data['team'] ?? [] as $member) {\n            $slug = Slugifier::slugify($member['name']);\n            $page = (new Page(\"team\/$slug\"))\n                -&gt;setType(Type::PAGE)\n                -&gt;setPath(\"team\/$slug\")\n                -&gt;setSection('team')\n                -&gt;setBodyHtml('&lt;p&gt;' . htmlspecialchars($member['role']) . '&lt;\/p&gt;')\n                -&gt;setVariable('title', $member['name']);\n            $this-&gt;generatedPages-&gt;add($page);\n        }\n    }\n}\nPuis déclarez-le :\npages:\n  generators:\n    Team: { class: MySite\\Generator\\Team, priority: 25 }\nLes pages créées par un générateur n’appartiennent à aucune section : setSection() est nécessaire pour les regrouper dans la section team. Comme toute autre page, elles sont listées dans site.pages.showable et dans le sitemap : définissez la variable excluded à true pour retirer une page des listes.\nConsultez la documentation de la configuration des données, de la variable site.data et des générateurs de pages.",
      "content_html": "<p>Les fichiers de données sont un moyen pratique de gérer du contenu structuré (membres d’une équipe, produits, événements, etc.) en dehors des pages, puis de l’afficher avec les templates.</p>\n<h2 id=\"ajouter-un-fichier-de-donnees\">Ajouter un fichier de données<a class=\"heading-anchor\" href=\"#ajouter-un-fichier-de-donnees\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Stockez vos fichiers dans le dossier <code translate=\"no\">data</code>. Les formats pris en charge sont YAML, JSON, XML et CSV.</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-comment\"># data/team.yml</span>\n<span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">Ada</span>\n  <span class=\"hljs-attr\">role:</span> <span class=\"hljs-string\">Developer</span>\n<span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">Grace</span>\n  <span class=\"hljs-attr\">role:</span> <span class=\"hljs-string\">Designer</span></code></pre>\n<aside class=\"note note-tip\"><p>Une version localisée peut être ajoutée avec un suffixe de langue (par exemple <code translate=\"no\">data/team.fr.yml</code>) : elle est utilisée pour les pages dans cette langue.</p>\n<p>Dès qu’une langue possède au moins un fichier de données localisé, <code translate=\"no\">site.data</code> ne contient plus que les fichiers localisés de cette langue : les fichiers non localisés ne sont alors plus disponibles pour ses pages.</p></aside>\n<h2 id=\"afficher-les-donnees-dans-un-template\">Afficher les données dans un template<a class=\"heading-anchor\" href=\"#afficher-les-donnees-dans-un-template\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Le fichier est disponible dans les templates via <code translate=\"no\">site.data.&lt;nom du fichier&gt;</code>, par exemple <code translate=\"no\">layouts/team.html.twig</code> :</p>\n<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\">\n\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">block</span></span> content %}</span><span class=\"xml\">\n  <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>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> member in site.data.team %}</span><span class=\"xml\">\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ member.name }}</span><span class=\"xml\">, </span><span class=\"hljs-template-variable\">{{ member.role }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">li</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">ul</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endblock</span></span> %}</span></code></pre>\n<p>Les fichiers des sous-dossiers sont imbriqués : <code translate=\"no\">data/galleries/gallery-1.json</code> est disponible via <code translate=\"no\">site.data.galleries['gallery-1']</code>.</p>\n<h2 id=\"creer-la-page\">Créer la page<a class=\"heading-anchor\" href=\"#creer-la-page\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La page qui utilise ce template n’a besoin d’aucun contenu : déclarez-la comme <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-default\">page par défaut</a> dans <code translate=\"no\">cecil.yml</code>, indexée par ID :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">default:</span>\n    <span class=\"hljs-attr\">team:</span>\n      <span class=\"hljs-attr\">path:</span> <span class=\"hljs-string\">team</span>\n      <span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Our</span> <span class=\"hljs-string\">team</span>\n      <span class=\"hljs-attr\">layout:</span> <span class=\"hljs-string\">team</span></code></pre>\n<p>Vous pouvez aussi créer un fichier <code translate=\"no\">pages/team.md</code> avec <code translate=\"no\">layout: team</code> dans son front matter.</p>\n<h2 id=\"generer-une-page-par-element\">Générer une page par élément<a class=\"heading-anchor\" href=\"#generer-une-page-par-element\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Pour générer une page par entrée, créez un <a href=\"https://cloudflare.cecil.app/fr/documentation/developpeurs/etendre/#generateurs-de-pages\">générateur de pages</a>. Les données chargées depuis les fichiers de données sont disponibles via <code translate=\"no\">$this-&gt;builder-&gt;getData()</code> :</p>\n<pre data-lang=\"php\"><code class=\"language-php hljs php\" translate=\"no\"><span class=\"hljs-meta\">&lt;?php</span>\n<span class=\"hljs-comment\">// extensions/MySite/Generator/Team.php</span>\n<span class=\"hljs-keyword\">namespace</span> <span class=\"hljs-title\">MySite</span>\\<span class=\"hljs-title\">Generator</span>;\n\n<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>;\n<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>;\n<span class=\"hljs-keyword\">use</span> <span class=\"hljs-title\">Cecil</span>\\<span class=\"hljs-title\">Generator</span>\\<span class=\"hljs-title\">AbstractGenerator</span>;\n<span class=\"hljs-keyword\">use</span> <span class=\"hljs-title\">Cecil</span>\\<span class=\"hljs-title\">Generator</span>\\<span class=\"hljs-title\">GeneratorInterface</span>;\n<span class=\"hljs-keyword\">use</span> <span class=\"hljs-title\">Cecil</span>\\<span class=\"hljs-title\">Util</span>\\<span class=\"hljs-title\">Slugifier</span>;\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class</span> <span class=\"hljs-title\">Team</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>\n</span>{\n    <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>\n    </span>{\n        $data = <span class=\"hljs-keyword\">$this</span>-&gt;builder-&gt;getData(<span class=\"hljs-keyword\">$this</span>-&gt;config-&gt;getLanguageDefault());\n        <span class=\"hljs-keyword\">foreach</span> ($data[<span class=\"hljs-string\">'team'</span>] ?? [] <span class=\"hljs-keyword\">as</span> $member) {\n            $slug = Slugifier::slugify($member[<span class=\"hljs-string\">'name'</span>]);\n            $page = (<span class=\"hljs-keyword\">new</span> Page(<span class=\"hljs-string\">\"team/$slug\"</span>))\n                -&gt;setType(Type::PAGE)\n                -&gt;setPath(<span class=\"hljs-string\">\"team/$slug\"</span>)\n                -&gt;setSection(<span class=\"hljs-string\">'team'</span>)\n                -&gt;setBodyHtml(<span class=\"hljs-string\">'&lt;p&gt;'</span> . htmlspecialchars($member[<span class=\"hljs-string\">'role'</span>]) . <span class=\"hljs-string\">'&lt;/p&gt;'</span>)\n                -&gt;setVariable(<span class=\"hljs-string\">'title'</span>, $member[<span class=\"hljs-string\">'name'</span>]);\n            <span class=\"hljs-keyword\">$this</span>-&gt;generatedPages-&gt;add($page);\n        }\n    }\n}</code></pre>\n<p>Puis déclarez-le :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">generators:</span>\n    <span class=\"hljs-attr\">Team:</span> <span class=\"hljs-string\">{</span> <span class=\"hljs-attr\">class:</span> <span class=\"hljs-string\">MySite\\Generator\\Team,</span> <span class=\"hljs-attr\">priority:</span> <span class=\"hljs-number\">25</span> <span class=\"hljs-string\">}</span></code></pre>\n<aside class=\"note note-info\"><p>Les pages créées par un générateur n’appartiennent à aucune section : <code translate=\"no\">setSection()</code> est nécessaire pour les regrouper dans la section <code translate=\"no\">team</code>. Comme toute autre page, elles sont listées dans <code translate=\"no\">site.pages.showable</code> et dans le sitemap : définissez la variable <code translate=\"no\">excluded</code> à <code translate=\"no\">true</code> pour retirer une page des listes.</p></aside>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/donnees-et-statiques/#donnees\">configuration des données</a>, de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/variables/#site-data\">variable <code translate=\"no\">site.data</code></a> et des <a href=\"https://cloudflare.cecil.app/fr/documentation/developpeurs/etendre/#generateurs-de-pages\">générateurs de pages</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-composants/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-composants/",
      "title": "Utiliser les composants Twig",
      "summary": "Créer des unités de template réutilisables avec les composants Cecil et la balise x.",
      "date_published": "2026-10-18T00:00:00+00:00","content_text": "Les composants sont de petits templates Twig réutilisables (bouton, carte, alerte, etc.) que l’on appelle avec une balise dédiée : ils acceptent des attributs et peuvent envelopper n’importe quel contenu.\nCréer un composant\nLes composants sont des templates Twig stockés dans le sous-répertoire components\/ du répertoire des layouts. Créez layouts\/components\/button.twig :\n&lt;button {{ attributes.merge({class: 'rounded px-4'}) }}&gt;\n  {{ slot }}\n&lt;\/button&gt;\n\nslot contient le contenu ajouté entre les balises d’ouverture et de fermeture\nattributes contient les attributs passés au composant, et merge() les combine avec des valeurs par défaut\n\nUtiliser le composant\nAppelez le composant avec la balise x suivie de : et du nom de fichier du composant, sans extension :\n{% x:button with {class: 'text-white'} %}\n  &lt;strong&gt;Click me&lt;\/strong&gt;\n{% endx %}\nRendu :\n&lt;button class=\"text-white rounded px-4\"&gt;\n  &lt;strong&gt;Click me&lt;\/strong&gt;\n&lt;\/button&gt;\nPasser des variables\nLes valeurs passées avec with sont aussi disponibles comme variables dans le composant. Par exemple, layouts\/components\/card.twig :\n&lt;article class=\"card\"&gt;\n  &lt;h2&gt;&lt;a href=\"{{ href }}\"&gt;{{ title }}&lt;\/a&gt;&lt;\/h2&gt;\n  {{ slot }}\n&lt;\/article&gt;\nUtilisez-le dans un template de liste :\n{% for p in page.pages.showable %}\n  {% x:card with {href: url(p), title: p.title} %}\n    &lt;p&gt;{{ p.description }}&lt;\/p&gt;\n  {% endx %}\n{% endfor %}\nChanger le répertoire des composants\nLe répertoire et l’extension des fichiers de composants peuvent être modifiés dans cecil.yml :\nlayouts:\n  components:\n    dir: components # répertoire source des composants\n    ext: twig       # extension des fichiers de composants\nConsultez la documentation des composants et de la configuration des composants. La fonctionnalité est fournie par l’extension Twig components.",
      "content_html": "<p>Les composants sont de petits templates Twig réutilisables (bouton, carte, alerte, etc.) que l’on appelle avec une balise dédiée : ils acceptent des attributs et peuvent envelopper n’importe quel contenu.</p>\n<h2 id=\"creer-un-composant\">Créer un composant<a class=\"heading-anchor\" href=\"#creer-un-composant\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Les composants sont des templates Twig stockés dans le sous-répertoire <code translate=\"no\">components/</code> du répertoire des layouts. Créez <code translate=\"no\">layouts/components/button.twig</code> :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><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>\n  </span><span class=\"hljs-template-variable\">{{ slot }}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">button</span>&gt;</span></span></code></pre>\n<ul>\n<li><code translate=\"no\">slot</code> contient le contenu ajouté entre les balises d’ouverture et de fermeture</li>\n<li><code translate=\"no\">attributes</code> contient les attributs passés au composant, et <code translate=\"no\">merge()</code> les combine avec des valeurs par défaut</li>\n</ul>\n<h2 id=\"utiliser-le-composant\">Utiliser le composant<a class=\"heading-anchor\" href=\"#utiliser-le-composant\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Appelez le composant avec la balise <code translate=\"no\">x</code> suivie de <code translate=\"no\">:</code> et du nom de fichier du composant, sans extension :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">x</span>:button with {class: 'text-white'} %}</span><span class=\"xml\">\n  <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>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endx</span> %}</span></code></pre>\n<p>Rendu :</p>\n<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>\n  <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>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">button</span>&gt;</span></code></pre>\n<h2 id=\"passer-des-variables\">Passer des variables<a class=\"heading-anchor\" href=\"#passer-des-variables\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Les valeurs passées avec <code translate=\"no\">with</code> sont aussi disponibles comme variables dans le composant. Par exemple, <code translate=\"no\">layouts/components/card.twig</code> :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">article</span> <span class=\"hljs-attr\">class</span>=<span class=\"hljs-string\">\"card\"</span>&gt;</span>\n  <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\">{{ href }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ 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>\n  </span><span class=\"hljs-template-variable\">{{ slot }}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">article</span>&gt;</span></span></code></pre>\n<p>Utilisez-le dans un template de liste :</p>\n<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 page.pages.showable %}</span><span class=\"xml\">\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">x</span>:card with {href: url(p), title: p.title} %}</span><span class=\"xml\">\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ p.description }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">p</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endx</span> %}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span></code></pre>\n<h2 id=\"changer-le-repertoire-des-composants\">Changer le répertoire des composants<a class=\"heading-anchor\" href=\"#changer-le-repertoire-des-composants\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Le répertoire et l’extension des fichiers de composants peuvent être modifiés dans <code translate=\"no\">cecil.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">layouts:</span>\n  <span class=\"hljs-attr\">components:</span>\n    <span class=\"hljs-attr\">dir:</span> <span class=\"hljs-string\">components</span> <span class=\"hljs-comment\"># répertoire source des composants</span>\n    <span class=\"hljs-attr\">ext:</span> <span class=\"hljs-string\">twig</span>       <span class=\"hljs-comment\"># extension des fichiers de composants</span></code></pre>\n<aside class=\"note note-info\"><p>Consultez la documentation des <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/composants/\">composants</a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/layouts/#layouts-components\">configuration des composants</a>. La fonctionnalité est fournie par l’<a href=\"https://github.com/giorgiopogliani/twig-components\" target=\"_blank\" rel=\"noopener noreferrer\">extension Twig components</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/contenu-programmation/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/contenu-programmation/",
      "title": "Programmer la publication d’une page",
      "summary": "Publier ou dépublier une page Cecil à une date donnée avec la variable de front matter schedule.",
      "date_published": "2026-10-17T00:00:00+00:00",
      "date_modified": "2026-10-18T00:00:00+00:00","content_text": "Avec la variable schedule, une page peut être rédigée à l’avance et publiée plus tard, ou retirée du site après une date donnée.\nPublier une page à une date\nLa page n’est publiée que si la date de génération est égale ou postérieure à la date publish :\n---\ntitle: Lancement du produit\nschedule:\n  publish: 2026-11-15\n---\nDépublier une page après une date\nLa page n’est publiée que si la date de génération est antérieure à la date expiry. Une date sans heure correspondant à minuit, la page est déjà dépubliée le jour même de l’expiration (ajoutez une heure, par exemple 2026-08-31 23:59:59, pour la conserver ce jour-là) :\n---\ntitle: Soldes d’été\nschedule:\n  expiry: 2026-08-31\n---\nPublier une page entre deux dates\nCombinez les deux dates : la page est publiée uniquement si la date publish est atteinte et que la date expiry n’est pas dépassée :\n---\ntitle: Black Friday\nschedule:\n  publish: 2026-11-27\n  expiry: 2026-12-01\n---\nRégénérer le site régulièrement\nUn site statique ne change pas tout seul : la programmation est évaluée au moment de la génération. Une page prévue pour le 15 novembre n’apparaîtra qu’après une génération lancée à partir de cette date.\nPour l’automatiser, régénérez le site chaque jour. Par exemple, avec GitHub Pages, ajoutez un déclencheur schedule à la section on de votre workflow :\n# .github\/workflows\/build-and-deploy.yml\non:\n  push:\n    branches: [master, main]\n  schedule:\n    - cron: '0 6 * * *' # tous les jours à 6h00 UTC\n  workflow_dispatch:\nSur les dépôts publics, GitHub désactive les workflows programmés après 60 jours sans activité sur le dépôt.\nLa plupart des plateformes Jamstack proposent une fonctionnalité similaire (générations programmées ou build hooks déclenchés par une tâche cron).\nPour vérifier le résultat en local, lancez php cecil.phar build --show-pages et cherchez votre page dans la liste des pages générées.\nConsultez la documentation de la variable schedule et du déploiement continu.",
      "content_html": "<p>Avec la variable <code translate=\"no\">schedule</code>, une page peut être rédigée à l’avance et publiée plus tard, ou retirée du site après une date donnée.</p>\n<h2 id=\"publier-une-page-a-une-date\">Publier une page à une date<a class=\"heading-anchor\" href=\"#publier-une-page-a-une-date\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La page n’est publiée que si la date de génération est égale ou postérieure à la date <code translate=\"no\">publish</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Lancement</span> <span class=\"hljs-string\">du</span> <span class=\"hljs-string\">produit</span>\n<span class=\"hljs-attr\">schedule:</span>\n  <span class=\"hljs-attr\">publish:</span> <span class=\"hljs-number\">2026</span><span class=\"hljs-number\">-11</span><span class=\"hljs-number\">-15</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<h2 id=\"depublier-une-page-apres-une-date\">Dépublier une page après une date<a class=\"heading-anchor\" href=\"#depublier-une-page-apres-une-date\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La page n’est publiée que si la date de génération est antérieure à la date <code translate=\"no\">expiry</code>. Une date sans heure correspondant à minuit, la page est déjà dépubliée le jour même de l’expiration (ajoutez une heure, par exemple <code translate=\"no\">2026-08-31 23:59:59</code>, pour la conserver ce jour-là) :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Soldes</span> <span class=\"hljs-string\">d’été</span>\n<span class=\"hljs-attr\">schedule:</span>\n  <span class=\"hljs-attr\">expiry:</span> <span class=\"hljs-number\">2026</span><span class=\"hljs-number\">-08</span><span class=\"hljs-number\">-31</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<h2 id=\"publier-une-page-entre-deux-dates\">Publier une page entre deux dates<a class=\"heading-anchor\" href=\"#publier-une-page-entre-deux-dates\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Combinez les deux dates : la page est publiée uniquement si la date <code translate=\"no\">publish</code> est atteinte <strong>et</strong> que la date <code translate=\"no\">expiry</code> n’est pas dépassée :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Black</span> <span class=\"hljs-string\">Friday</span>\n<span class=\"hljs-attr\">schedule:</span>\n  <span class=\"hljs-attr\">publish:</span> <span class=\"hljs-number\">2026</span><span class=\"hljs-number\">-11</span><span class=\"hljs-number\">-27</span>\n  <span class=\"hljs-attr\">expiry:</span> <span class=\"hljs-number\">2026</span><span class=\"hljs-number\">-12</span><span class=\"hljs-number\">-01</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<h2 id=\"regenerer-le-site-regulierement\">Régénérer le site régulièrement<a class=\"heading-anchor\" href=\"#regenerer-le-site-regulierement\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Un site statique ne change pas tout seul : la programmation est évaluée <strong>au moment de la génération</strong>. Une page prévue pour le 15 novembre n’apparaîtra qu’après une génération lancée à partir de cette date.</p>\n<p>Pour l’automatiser, régénérez le site chaque jour. Par exemple, avec <a href=\"https://cloudflare.cecil.app/fr/documentation/deployer/deploiement-continu/#github-pages\">GitHub Pages</a>, ajoutez un déclencheur <code translate=\"no\">schedule</code> à la section <code translate=\"no\">on</code> de votre workflow :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-comment\"># .github/workflows/build-and-deploy.yml</span>\n<span class=\"hljs-attr\">on:</span>\n  <span class=\"hljs-attr\">push:</span>\n    <span class=\"hljs-attr\">branches:</span> <span class=\"hljs-string\">[master,</span> <span class=\"hljs-string\">main]</span>\n  <span class=\"hljs-attr\">schedule:</span>\n    <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">cron:</span> <span class=\"hljs-string\">'0 6 * * *'</span> <span class=\"hljs-comment\"># tous les jours à 6h00 UTC</span>\n  <span class=\"hljs-attr\">workflow_dispatch:</span></code></pre>\n<p>Sur les dépôts publics, GitHub désactive les workflows programmés après 60 jours sans activité sur le dépôt.</p>\n<p>La plupart des plateformes Jamstack proposent une fonctionnalité similaire (générations programmées ou <em>build hooks</em> déclenchés par une tâche cron).</p>\n<aside class=\"note note-tip\"><p>Pour vérifier le résultat en local, lancez <code translate=\"no\">php cecil.phar build --show-pages</code> et cherchez votre page dans la liste des pages générées.</p></aside>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#planification\">variable <code translate=\"no\">schedule</code></a> et du <a href=\"https://cloudflare.cecil.app/fr/documentation/deployer/deploiement-continu/#github-pages\">déploiement continu</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/sortie-sitemap-robots/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/sortie-sitemap-robots/",
      "title": "Personnaliser le sitemap et le robots.txt",
      "summary": "Contrôler les fichiers sitemap XML et robots.txt générés par Cecil, exclure des pages et surcharger les templates.",
      "date_published": "2026-10-16T00:00:00+00:00",
      "date_modified": "2026-10-20T00:00:00+00:00","content_text": "Cecil génère automatiquement \/sitemap.xml et \/robots.txt : ce sont des pages par défaut générées avec les templates intégrés _default\/sitemap.xml.twig et _default\/robots.txt.twig.\nFonctionnement\nLes deux pages sont déclarées dans la configuration par défaut :\npages:\n  default:\n    robots:\n      path: robots\n      layout: robots\n      output: txt\n    sitemap:\n      path: sitemap\n      layout: sitemap\n      output: xml\n      changefreq: monthly\n      priority: 0.5\n\nle sitemap liste toutes les pages affichables (publiées, ni paginées, ni redirigées, ni exclues), y compris les sections et les taxonomies, avec leurs traductions ;\nle robots.txt autorise tout, interdit les pages de redirection et la page 404, et indique l’emplacement du sitemap.\n\nDéfinissez baseurl dans cecil.yml : les deux fichiers utilisent des URL absolues.\nExclure une page du sitemap\nAjoutez excluded dans le front matter de la page :\n---\ntitle: Merci\nexcluded: true\n---\nLa page est toujours publiée, mais retirée du sitemap et des pages de liste (page d’accueil, sections, etc.). Utilisez published: false pour ne pas la publier du tout.\nModifier la fréquence et la priorité par défaut\npages:\n  default:\n    sitemap:\n      changefreq: weekly\n      priority: 0.8\nVous pouvez aussi les définir page par page, dans le front matter :\n---\ntitle: Actualités\nsitemap:\n  changefreq: daily\n  priority: 0.9\n---\nLes pages ayant une URL canonique personnalisée (canonical.url dans le front matter) ne sont pas listées dans le sitemap.\nAjouter des règles au robots.txt\nCréez une page pages\/robots.md : son contenu est ajouté aux règles générées. Comme elle remplace la page robots par défaut, définissez excluded: true pour l’exclure du sitemap et des pages de liste.\n---\nlayout: robots\nexcluded: true\noutput: txt\n---\nUser-agent: GPTBot\nDisallow: \/\nSurcharger les templates\nExtrayez les templates intégrés pour partir des originaux :\nphp cecil.phar util:templates:extract\nOu créez layouts\/sitemap.xml.twig (ou layouts\/robots.txt.twig) de zéro. Par exemple, un sitemap qui ignore aussi les pages ayant une variable de front matter personnalisée sitemap_exclude :\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\n  {%- for p in site.pages.showable|filter(p =&gt; not p.sitemap_exclude|default(false))|sort_by_date ~%}\n  &lt;url&gt;\n    &lt;loc&gt;{{ url(p, {canonical: true}) }}&lt;\/loc&gt;\n    &lt;lastmod&gt;{{ p.date|date('Y-m-d') }}&lt;\/lastmod&gt;\n  &lt;\/url&gt;\n  {%- endfor ~%}\n&lt;\/urlset&gt;\nPour désactiver l’un de ces fichiers, dépubliez sa page par défaut :\npages:\n  default:\n    sitemap:\n      published: false",
      "content_html": "<p>Cecil génère automatiquement <code translate=\"no\">/sitemap.xml</code> et <code translate=\"no\">/robots.txt</code> : ce sont des <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-default\">pages par défaut</a> générées avec les templates intégrés <code translate=\"no\">_default/sitemap.xml.twig</code> et <code translate=\"no\">_default/robots.txt.twig</code>.</p>\n<h2 id=\"fonctionnement\">Fonctionnement<a class=\"heading-anchor\" href=\"#fonctionnement\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Les deux pages sont déclarées dans la configuration par défaut :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">default:</span>\n    <span class=\"hljs-attr\">robots:</span>\n      <span class=\"hljs-attr\">path:</span> <span class=\"hljs-string\">robots</span>\n      <span class=\"hljs-attr\">layout:</span> <span class=\"hljs-string\">robots</span>\n      <span class=\"hljs-attr\">output:</span> <span class=\"hljs-string\">txt</span>\n    <span class=\"hljs-attr\">sitemap:</span>\n      <span class=\"hljs-attr\">path:</span> <span class=\"hljs-string\">sitemap</span>\n      <span class=\"hljs-attr\">layout:</span> <span class=\"hljs-string\">sitemap</span>\n      <span class=\"hljs-attr\">output:</span> <span class=\"hljs-string\">xml</span>\n      <span class=\"hljs-attr\">changefreq:</span> <span class=\"hljs-string\">monthly</span>\n      <span class=\"hljs-attr\">priority:</span> <span class=\"hljs-number\">0.5</span></code></pre>\n<ul>\n<li>le <strong>sitemap</strong> liste toutes les pages affichables (publiées, ni paginées, ni redirigées, ni exclues), y compris les sections et les taxonomies, avec leurs traductions ;</li>\n<li>le <strong>robots.txt</strong> autorise tout, interdit les pages de redirection et la page 404, et indique l’emplacement du sitemap.</li>\n</ul>\n<aside class=\"note note-important\"><p>Définissez <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/site/#baseurl\"><code translate=\"no\">baseurl</code></a> dans <code translate=\"no\">cecil.yml</code> : les deux fichiers utilisent des URL absolues.</p></aside>\n<h2 id=\"exclure-une-page-du-sitemap\">Exclure une page du sitemap<a class=\"heading-anchor\" href=\"#exclure-une-page-du-sitemap\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#excluded\"><code translate=\"no\">excluded</code></a> dans le front matter de la page :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Merci</span>\n<span class=\"hljs-attr\">excluded:</span> <span class=\"hljs-literal\">true</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<p>La page est toujours publiée, mais retirée du sitemap et des pages de liste (page d’accueil, sections, etc.). Utilisez <code translate=\"no\">published: false</code> pour ne pas la publier du tout.</p>\n<h2 id=\"modifier-la-frequence-et-la-priorite-par-defaut\">Modifier la fréquence et la priorité par défaut<a class=\"heading-anchor\" href=\"#modifier-la-frequence-et-la-priorite-par-defaut\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">default:</span>\n    <span class=\"hljs-attr\">sitemap:</span>\n      <span class=\"hljs-attr\">changefreq:</span> <span class=\"hljs-string\">weekly</span>\n      <span class=\"hljs-attr\">priority:</span> <span class=\"hljs-number\">0.8</span></code></pre>\n<p>Vous pouvez aussi les définir page par page, dans le front matter :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Actualités</span>\n<span class=\"hljs-attr\">sitemap:</span>\n  <span class=\"hljs-attr\">changefreq:</span> <span class=\"hljs-string\">daily</span>\n  <span class=\"hljs-attr\">priority:</span> <span class=\"hljs-number\">0.9</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<aside class=\"note note-info\"><p>Les pages ayant une URL canonique personnalisée (<code translate=\"no\">canonical.url</code> dans le front matter) ne sont pas listées dans le sitemap.</p></aside>\n<h2 id=\"ajouter-des-regles-au-robots-txt\">Ajouter des règles au robots.txt<a class=\"heading-anchor\" href=\"#ajouter-des-regles-au-robots-txt\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Créez une page <code translate=\"no\">pages/robots.md</code> : son contenu est ajouté aux règles générées. Comme elle remplace la page <code translate=\"no\">robots</code> par défaut, définissez <code translate=\"no\">excluded: true</code> pour l’exclure du sitemap et des pages de liste.</p>\n<pre data-lang=\"markdown\"><code class=\"language-markdown hljs markdown\" translate=\"no\">---\nlayout: robots\nexcluded: true\n<span class=\"hljs-section\">output: txt\n---</span>\nUser-agent: GPTBot\nDisallow: /</code></pre>\n<h2 id=\"surcharger-les-templates\">Surcharger les templates<a class=\"heading-anchor\" href=\"#surcharger-les-templates\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Extrayez les <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/regles-de-recherche/#templates-integres\">templates intégrés</a> pour partir des originaux :</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar util:templates:extract</code></pre>\n<p>Ou créez <code translate=\"no\">layouts/sitemap.xml.twig</code> (ou <code translate=\"no\">layouts/robots.txt.twig</code>) de zéro. Par exemple, un sitemap qui ignore aussi les pages ayant une variable de front matter personnalisée <code translate=\"no\">sitemap_exclude</code> :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-meta\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">urlset</span> <span class=\"hljs-attr\">xmlns</span>=<span class=\"hljs-string\">\"http://www.sitemaps.org/schemas/sitemap/0.9\"</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{%- <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> p in site.pages.showable|<span class=\"hljs-keyword\">filter</span>(p =&gt; not p.sitemap_exclude|<span class=\"hljs-keyword\">default</span>(false))|sort_by_date ~%}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">url</span>&gt;</span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">loc</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ url(p, {canonical: true}) }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">loc</span>&gt;</span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">lastmod</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ p.<span class=\"hljs-name\">date</span>|<span class=\"hljs-keyword\">date</span>('Y-m-d') }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">lastmod</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">url</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{%- <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> ~%}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">urlset</span>&gt;</span></span></code></pre>\n<aside class=\"note note-tip\"><p>Pour désactiver l’un de ces fichiers, dépubliez sa page par défaut :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">default:</span>\n    <span class=\"hljs-attr\">sitemap:</span>\n      <span class=\"hljs-attr\">published:</span> <span class=\"hljs-literal\">false</span></code></pre></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-placeholder-lqip/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-placeholder-lqip/",
      "title": "Afficher un aperçu des images pendant leur chargement",
      "summary": "Afficher une couleur dominante ou un aperçu flouté pendant le chargement des images dans les templates Cecil.",
      "date_published": "2026-10-15T00:00:00+00:00",
      "date_modified": "2026-10-18T00:00:00+00:00","content_text": "Les images sont souvent les ressources les plus lourdes d’une page. Pendant leur chargement, Cecil peut remplir leur emplacement avec une couleur dominante ou un aperçu basse qualité (LQIP, Low-Quality Image Placeholder), pour éviter les blocs vides et améliorer la performance perçue.\nAvec la fonction html\nLe plus simple est d’utiliser l’option placeholder de la fonction html, avec la valeur color ou lqip :\n{{ html(asset('images\/photo.jpg'), {alt: 'Description', loading: 'lazy'}, {placeholder: 'lqip'}) }}\nPour l’appliquer à toutes les images générées avec html, définissez une valeur par défaut dans cecil.yml :\nlayouts:\n  images:\n    placeholder: color # `color` ou `lqip`\nL’option placeholder de la fonction html ne s’applique qu’aux images JPEG, PNG et GIF, et le placeholder lqip est ignoré pour les GIF animés.\nAvec les filtres\nPour un balisage personnalisé, utilisez directement les filtres :\n\nlqip : renvoie une version minuscule et floutée de l’image sous forme de data URL\ndominant_color : renvoie la couleur dominante de l’image sous forme de valeur de couleur CSS (par exemple rgb(120 85 60))\n\nCouleur dominante\n{% set image = asset('images\/photo.jpg') %}\n&lt;img src=\"{{ url(image) }}\" width=\"{{ image.width }}\" height=\"{{ image.height }}\" alt=\"Description\" loading=\"lazy\"\n  style=\"background-color: {{ image|dominant_color }};\"&gt;\nAperçu flouté\n{% set image = asset('images\/photo.jpg') %}\n&lt;img src=\"{{ url(image) }}\" width=\"{{ image.width }}\" height=\"{{ image.height }}\" alt=\"Description\" loading=\"lazy\"\n  class=\"placeholder\" style=\"background-image: url({{ image|lqip }});\"&gt;\nÉtirez l’aperçu sur toute la surface de l’image en CSS :\nimg.placeholder {\n  max-width: 100%;\n  height: auto;\n  background-size: cover;\n  background-repeat: no-repeat;\n}\nL’arrière-plan reste visible jusqu’à ce que l’image réelle soit chargée et affichée par-dessus.\nLes images en Markdown prennent aussi en charge les placeholders : ![](\/images\/photo.jpg){placeholder=lqip}, ou globalement avec l’option pages.body.images.placeholder.\nConsultez la documentation du filtre lqip, du filtre dominant_color et de la fonction html.",
      "content_html": "<p>Les images sont souvent les ressources les plus lourdes d’une page. Pendant leur chargement, Cecil peut remplir leur emplacement avec une <strong>couleur dominante</strong> ou un <strong>aperçu basse qualité</strong> (LQIP, <em>Low-Quality Image Placeholder</em>), pour éviter les blocs vides et améliorer la performance perçue.</p>\n<h2 id=\"avec-la-fonction-html\">Avec la fonction html<a class=\"heading-anchor\" href=\"#avec-la-fonction-html\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Le plus simple est d’utiliser l’option <code translate=\"no\">placeholder</code> de la fonction <code translate=\"no\">html</code>, avec la valeur <code translate=\"no\">color</code> ou <code translate=\"no\">lqip</code> :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset('images/photo.jpg'), {alt: 'Description', loading: 'lazy'}, {placeholder: 'lqip'}) }}</span></code></pre>\n<p>Pour l’appliquer à toutes les images générées avec <code translate=\"no\">html</code>, définissez une valeur par défaut dans <code translate=\"no\">cecil.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">layouts:</span>\n  <span class=\"hljs-attr\">images:</span>\n    <span class=\"hljs-attr\">placeholder:</span> <span class=\"hljs-string\">color</span> <span class=\"hljs-comment\"># `color` ou `lqip`</span></code></pre>\n<aside class=\"note note-important\"><p>L’option <code translate=\"no\">placeholder</code> de la fonction <code translate=\"no\">html</code> ne s’applique qu’aux images JPEG, PNG et GIF, et le <em>placeholder</em> <code translate=\"no\">lqip</code> est ignoré pour les GIF animés.</p></aside>\n<h2 id=\"avec-les-filtres\">Avec les filtres<a class=\"heading-anchor\" href=\"#avec-les-filtres\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Pour un balisage personnalisé, utilisez directement les filtres :</p>\n<ul>\n<li><code translate=\"no\">lqip</code> : renvoie une version minuscule et floutée de l’image sous forme de <em>data URL</em></li>\n<li><code translate=\"no\">dominant_color</code> : renvoie la couleur dominante de l’image sous forme de valeur de couleur CSS (par exemple <code translate=\"no\">rgb(120 85 60)</code>)</li>\n</ul>\n<h3 id=\"couleur-dominante\">Couleur dominante<a class=\"heading-anchor\" href=\"#couleur-dominante\" aria-hidden=\"true\" tabindex=\"-1\"></a></h3>\n<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('images/photo.jpg') %}</span><span class=\"xml\">\n<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(image) }}</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\">{{ image.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\">{{ image.height }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span> <span class=\"hljs-attr\">alt</span>=<span class=\"hljs-string\">\"Description\"</span> <span class=\"hljs-attr\">loading</span>=<span class=\"hljs-string\">\"lazy\"</span>\n  <span class=\"hljs-attr\">style</span>=<span class=\"hljs-string\">\"background-color: </span></span></span><span class=\"hljs-template-variable\">{{ image|dominant_color }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">;\"</span>&gt;</span></span></code></pre>\n<h3 id=\"apercu-floute\">Aperçu flouté<a class=\"heading-anchor\" href=\"#apercu-floute\" aria-hidden=\"true\" tabindex=\"-1\"></a></h3>\n<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('images/photo.jpg') %}</span><span class=\"xml\">\n<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(image) }}</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\">{{ image.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\">{{ image.height }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span> <span class=\"hljs-attr\">alt</span>=<span class=\"hljs-string\">\"Description\"</span> <span class=\"hljs-attr\">loading</span>=<span class=\"hljs-string\">\"lazy\"</span>\n  <span class=\"hljs-attr\">class</span>=<span class=\"hljs-string\">\"placeholder\"</span> <span class=\"hljs-attr\">style</span>=<span class=\"hljs-string\">\"background-image: url(</span></span></span><span class=\"hljs-template-variable\">{{ image|lqip }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">);\"</span>&gt;</span></span></code></pre>\n<p>Étirez l’aperçu sur toute la surface de l’image en CSS :</p>\n<pre data-lang=\"css\"><code class=\"language-css hljs css\" translate=\"no\"><span class=\"hljs-selector-tag\">img</span><span class=\"hljs-selector-class\">.placeholder</span> {\n  <span class=\"hljs-attribute\">max-width</span>: <span class=\"hljs-number\">100%</span>;\n  <span class=\"hljs-attribute\">height</span>: auto;\n  <span class=\"hljs-attribute\">background-size</span>: cover;\n  <span class=\"hljs-attribute\">background-repeat</span>: no-repeat;\n}</code></pre>\n<p>L’arrière-plan reste visible jusqu’à ce que l’image réelle soit chargée et affichée par-dessus.</p>\n<aside class=\"note note-tip\"><p>Les images en Markdown prennent aussi en charge les <em>placeholders</em> : <code translate=\"no\">![](/images/photo.jpg){placeholder=lqip}</code>, ou globalement avec l’<a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-body-images\">option <code translate=\"no\">pages.body.images.placeholder</code></a>.</p></aside>\n<aside class=\"note note-info\"><p>Consultez la documentation du <a href=\"https://cloudflare.cecil.app/fr/documentation/assets/images/#lqip\">filtre <code translate=\"no\">lqip</code></a>, du <a href=\"https://cloudflare.cecil.app/fr/documentation/assets/images/#dominant-color\">filtre <code translate=\"no\">dominant_color</code></a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/fonctions/#html\">fonction <code translate=\"no\">html</code></a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/markdown-sommaire-notes/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/markdown-sommaire-notes/",
      "title": "Ajouter une table des matières et des notes",
      "summary": "Enrichir les pages Markdown de Cecil avec une table des matières, des blocs de notes et des attributs personnalisés.",
      "date_published": "2026-10-14T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Cecil étend Markdown avec quelques fonctionnalités pratiques pour les pages longues : une table des matières automatique, des blocs de notes et des attributs sur les éléments.\nInsérer une table des matières\nAjoutez la balise [toc] à l’endroit où la table des matières doit apparaître dans le corps de la page :\n[toc]\n\n## Installation\n### Requirements\n## Usage\nPar défaut, la table des matières est construite à partir des titres H2 et H3. Modifiez ce comportement dans cecil.yml :\npages:\n  body:\n    toc: [h2, h3, h4]\nAfficher la table des matières dans un template\nPour placer la table des matières en dehors du contenu (par exemple dans une barre latérale), utilisez le filtre toc sur le corps de la page :\n&lt;aside&gt;\n  {{ page.body|toc }}\n&lt;\/aside&gt;\n&lt;article&gt;\n  {{ page.content }}\n&lt;\/article&gt;\nLe filtre accepte aussi les titres à extraire, par exemple {{ page.body|toc(selectors=['h2']) }}.\nAjouter des notes\nMettez en avant une information avec un bloc de note :\n:::tip\n**Astuce :** ceci est un conseil.\n:::\nCe bloc est converti en :\n&lt;aside class=\"note note-tip\"&gt;\n  &lt;p&gt;\n    &lt;strong&gt;Astuce :&lt;\/strong&gt; ceci est un conseil.\n  &lt;\/p&gt;\n&lt;\/aside&gt;\nLes types disponibles sont info, tip, important, warning et caution (ou aucun type). Stylisez-les avec les classes CSS note et note-&lt;type&gt;.\nPour imbriquer des notes, utilisez une clôture plus longue pour la note parente (::::, puis ::::: pour un troisième niveau, etc.) :\n::::info\nAvant.\n\n:::tip\n**Astuce :** ceci est un conseil.\n:::\n\nAprès.\n::::\nCecil fournit aussi des templates de notes pour structurer le contenu sans JavaScript : tabs, code-group, steps, accordion et cards. Leurs éléments sont définis par des titres #### (ou par les entrées d’une liste pour cards), et chaque type est rendu avec le template partials\/notes\/&lt;type&gt;.html.twig, que vous pouvez surcharger.\nAjouter des attributs\nDéfinissez un identifiant (id), une classe ou n’importe quel attribut sur un titre, un bloc de code, un lien ou une image, entre accolades à la fin de la ligne :\n## Installation {#install .highlighted}\nL’identifiant #install fournit une ancre stable vers laquelle créer un lien : [Voir l’installation](#install).\nPour un élément en ligne, comme un lien, ajoutez un saut de ligne après l’accolade fermante.\nConsultez la documentation de la table des matières, des notes et de leurs templates, des attributs et du filtre toc.",
      "content_html": "<p>Cecil étend Markdown avec quelques fonctionnalités pratiques pour les pages longues : une table des matières automatique, des blocs de notes et des attributs sur les éléments.</p>\n<h2 id=\"inserer-une-table-des-matieres\">Insérer une table des matières<a class=\"heading-anchor\" href=\"#inserer-une-table-des-matieres\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez la balise <code translate=\"no\">[toc]</code> à l’endroit où la table des matières doit apparaître dans le corps de la page :</p>\n<pre data-lang=\"markdown\"><code class=\"language-markdown hljs markdown\" translate=\"no\">[toc]\n\n<span class=\"hljs-section\">## Installation</span>\n<span class=\"hljs-section\">### Requirements</span>\n<span class=\"hljs-section\">## Usage</span></code></pre>\n<p>Par défaut, la table des matières est construite à partir des titres H2 et H3. Modifiez ce comportement dans <code translate=\"no\">cecil.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">body:</span>\n    <span class=\"hljs-attr\">toc:</span> <span class=\"hljs-string\">[h2,</span> <span class=\"hljs-string\">h3,</span> <span class=\"hljs-string\">h4]</span></code></pre>\n<h2 id=\"afficher-la-table-des-matieres-dans-un-template\">Afficher la table des matières dans un template<a class=\"heading-anchor\" href=\"#afficher-la-table-des-matieres-dans-un-template\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Pour placer la table des matières en dehors du contenu (par exemple dans une barre latérale), utilisez le filtre <code translate=\"no\">toc</code> sur le corps de la page :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">aside</span>&gt;</span>\n  </span><span class=\"hljs-template-variable\">{{ page.body|toc }}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">aside</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">article</span>&gt;</span>\n  </span><span class=\"hljs-template-variable\">{{ page.content }}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">article</span>&gt;</span></span></code></pre>\n<p>Le filtre accepte aussi les titres à extraire, par exemple <code translate=\"no\">{{ page.body|toc(selectors=['h2']) }}</code>.</p>\n<h2 id=\"ajouter-des-notes\">Ajouter des notes<a class=\"heading-anchor\" href=\"#ajouter-des-notes\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Mettez en avant une information avec un bloc de note :</p>\n<pre data-lang=\"markdown\"><code class=\"language-markdown hljs markdown\" translate=\"no\">:::tip\n<span class=\"hljs-strong\">**Astuce :**</span> ceci est un conseil.\n:::</code></pre>\n<p>Ce bloc est converti en :</p>\n<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>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p</span>&gt;</span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong</span>&gt;</span>Astuce :<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">strong</span>&gt;</span> ceci est un conseil.\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">p</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">aside</span>&gt;</span></code></pre>\n<p>Les types disponibles sont <code translate=\"no\">info</code>, <code translate=\"no\">tip</code>, <code translate=\"no\">important</code>, <code translate=\"no\">warning</code> et <code translate=\"no\">caution</code> (ou aucun type). Stylisez-les avec les classes CSS <code translate=\"no\">note</code> et <code translate=\"no\">note-&lt;type&gt;</code>.</p>\n<p>Pour imbriquer des notes, utilisez une clôture plus longue pour la note parente (<code translate=\"no\">::::</code>, puis <code translate=\"no\">:::::</code> pour un troisième niveau, etc.) :</p>\n<pre data-lang=\"markdown\"><code class=\"language-markdown hljs markdown\" translate=\"no\">::::info\nAvant.\n\n:::tip\n<span class=\"hljs-strong\">**Astuce :**</span> ceci est un conseil.\n:::\n\nAprès.\n::::</code></pre>\n<p>Cecil fournit aussi des templates de notes pour structurer le contenu sans JavaScript : <code translate=\"no\">tabs</code>, <code translate=\"no\">code-group</code>, <code translate=\"no\">steps</code>, <code translate=\"no\">accordion</code> et <code translate=\"no\">cards</code>. Leurs éléments sont définis par des titres <code translate=\"no\">####</code> (ou par les entrées d’une liste pour <code translate=\"no\">cards</code>), et chaque type est rendu avec le template <code translate=\"no\">partials/notes/&lt;type&gt;.html.twig</code>, que vous pouvez surcharger.</p>\n<h2 id=\"ajouter-des-attributs\">Ajouter des attributs<a class=\"heading-anchor\" href=\"#ajouter-des-attributs\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Définissez un identifiant (<code translate=\"no\">id</code>), une classe ou n’importe quel attribut sur un titre, un bloc de code, un lien ou une image, entre accolades à la fin de la ligne :</p>\n<pre data-lang=\"markdown\"><code class=\"language-markdown hljs markdown\" translate=\"no\"><span class=\"hljs-section\">## Installation {#install .highlighted}</span></code></pre>\n<p>L’identifiant <code translate=\"no\">#install</code> fournit une ancre stable vers laquelle créer un lien : <code translate=\"no\">[Voir l’installation](#install)</code>.</p>\n<aside class=\"note note-warning\"><p>Pour un élément en ligne, comme un lien, ajoutez un saut de ligne après l’accolade fermante.</p></aside>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/markdown/#table-des-matieres\">table des matières</a>, des <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/markdown/#notes\">notes</a> et de leurs <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/markdown/#templates\">templates</a>, des <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/markdown/#attributs\">attributs</a> et du <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/filtres/#toc\">filtre <code translate=\"no\">toc</code></a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/contenu-redirection-alias/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/contenu-redirection-alias/",
      "title": "Rediriger d’anciennes URL",
      "summary": "Conserver le fonctionnement des anciens liens dans Cecil avec les variables de front matter redirect et alias.",
      "date_published": "2026-10-13T00:00:00+00:00",
      "date_modified": "2026-10-20T00:00:00+00:00","content_text": "Quand une page est déplacée ou renommée, son ancienne URL ne doit pas mener à une erreur 404. Cecil propose deux variables de front matter pour cela : alias et redirect.\nRediriger d’anciennes URL vers une page\nLa variable alias liste les anciens chemins de la page courante. Chacun d’eux redirige vers la page :\n---\ntitle: About\nalias:\n  - company\n  - about-us\n---\nDans cet exemple, \/company\/ et \/about-us\/ redirigent vers \/about\/.\nRediriger une page vers une autre URL\nLa variable redirect transforme une page en redirection vers l’URL indiquée, interne ou externe :\n---\ntitle: Ancienne documentation\nredirect: \"https:\/\/cecil.app\/documentation\/\"\n---\nSans fichier Markdown\nSi l’ancienne page n’a plus de contenu, déclarez-la comme page par défaut dans cecil.yml, indexée par ID :\npages:\n  default:\n    code:\n      path: code\n      redirect: https:\/\/github.com\/Cecilapp\/Cecil\nPages générées\nPour chaque alias et chaque redirection, Cecil génère une page avec le template intégré redirect.html.twig. Elle contient :\n\nun &lt;link rel=\"canonical\"&gt; vers l’URL cible\nune balise &lt;meta name=\"robots\" content=\"noindex\"&gt;, pour que les moteurs de recherche ne l’indexent pas\nune balise &lt;meta http-equiv=\"refresh\"&gt; et une redirection JavaScript\nun lien de secours pour les visiteurs\n\nPour personnaliser cette page, créez votre propre template layouts\/redirect.html.twig : il est prioritaire sur le template intégré.\nConsultez la documentation des variables redirect et alias.",
      "content_html": "<p>Quand une page est déplacée ou renommée, son ancienne URL ne doit pas mener à une erreur 404. Cecil propose deux variables de front matter pour cela : <code translate=\"no\">alias</code> et <code translate=\"no\">redirect</code>.</p>\n<h2 id=\"rediriger-d-anciennes-url-vers-une-page\">Rediriger d’anciennes URL vers une page<a class=\"heading-anchor\" href=\"#rediriger-d-anciennes-url-vers-une-page\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La variable <code translate=\"no\">alias</code> liste les anciens chemins de la page courante. Chacun d’eux redirige vers la page :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">About</span>\n<span class=\"hljs-attr\">alias:</span>\n  <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">company</span>\n  <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">about-us</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<p>Dans cet exemple, <code translate=\"no\">/company/</code> et <code translate=\"no\">/about-us/</code> redirigent vers <code translate=\"no\">/about/</code>.</p>\n<h2 id=\"rediriger-une-page-vers-une-autre-url\">Rediriger une page vers une autre URL<a class=\"heading-anchor\" href=\"#rediriger-une-page-vers-une-autre-url\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La variable <code translate=\"no\">redirect</code> transforme une page en redirection vers l’URL indiquée, interne ou externe :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Ancienne</span> <span class=\"hljs-string\">documentation</span>\n<span class=\"hljs-attr\">redirect:</span> <span class=\"hljs-string\">\"https://cecil.app/documentation/\"</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<h2 id=\"sans-fichier-markdown\">Sans fichier Markdown<a class=\"heading-anchor\" href=\"#sans-fichier-markdown\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Si l’ancienne page n’a plus de contenu, déclarez-la comme <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-default\">page par défaut</a> dans <code translate=\"no\">cecil.yml</code>, indexée par ID :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">default:</span>\n    <span class=\"hljs-attr\">code:</span>\n      <span class=\"hljs-attr\">path:</span> <span class=\"hljs-string\">code</span>\n      <span class=\"hljs-attr\">redirect:</span> <span class=\"hljs-string\">https://github.com/Cecilapp/Cecil</span></code></pre>\n<h2 id=\"pages-generees\">Pages générées<a class=\"heading-anchor\" href=\"#pages-generees\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Pour chaque alias et chaque redirection, Cecil génère une page avec le template intégré <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>. Elle contient :</p>\n<ul>\n<li>un <code translate=\"no\">&lt;link rel=\"canonical\"&gt;</code> vers l’URL cible</li>\n<li>une balise <code translate=\"no\">&lt;meta name=\"robots\" content=\"noindex\"&gt;</code>, pour que les moteurs de recherche ne l’indexent pas</li>\n<li>une balise <code translate=\"no\">&lt;meta http-equiv=\"refresh\"&gt;</code> et une redirection JavaScript</li>\n<li>un lien de secours pour les visiteurs</li>\n</ul>\n<aside class=\"note note-tip\"><p>Pour personnaliser cette page, créez votre propre template <code translate=\"no\">layouts/redirect.html.twig</code> : il est prioritaire sur le template intégré.</p></aside>\n<aside class=\"note note-info\"><p>Consultez la documentation des variables <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#redirect\"><code translate=\"no\">redirect</code></a> et <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#alias\"><code translate=\"no\">alias</code></a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/configuration-environnements/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/configuration-environnements/",
      "title": "Utiliser des réglages différents selon l’environnement",
      "summary": "Surcharger la configuration de Cecil selon l’environnement avec les variables d’environnement CECIL_ et des fichiers de configuration supplémentaires.",
      "date_published": "2026-10-12T00:00:00+00:00",
      "date_modified": "2026-10-18T00:00:00+00:00","content_text": "Le site local et le site de production partagent rarement les mêmes réglages : URL de base, mode débogage, répertoire de sortie… Cecil permet de conserver un unique cecil.yml et de le surcharger selon l’environnement.\nGarder les valeurs de production dans cecil.yml\ntitle: \"My site\"\nbaseurl: https:\/\/example.com\/\ndebug: false\nSurcharger avec des fichiers de configuration supplémentaires\nCréez un fichier contenant uniquement les clés à modifier, par exemple config\/dev.yml :\ndebug: true\ncache:\n  enabled: false\nPuis chargez-le avec l’option --config, disponible avec les commandes build et serve :\nphp cecil.phar serve --config=config\/dev.yml\nInutile de définir baseurl pour la prévisualisation locale : la commande serve génère le site avec sa propre URL locale (par exemple http:\/\/localhost:8000\/), sauf si la variable d’environnement CECIL_BASEURL est définie, y compris dans un fichier .env (voir ci-dessous).\nVous pouvez passer plusieurs fichiers, séparés par des virgules. Ils sont fusionnés dans l’ordre après cecil.yml : chaque fichier surcharge donc les précédents.\nphp cecil.phar build --config=config\/prod.yml,config\/local.yml\nLes listes de valeurs sont remplacées, pas fusionnées : si cecil.yml définit pages.body.toc: [h2, h3] et qu’un fichier supplémentaire définit pages.body.toc: [h4], le résultat est [h4]. Pour ajouter ou retirer une valeur, utilisez plutôt une table de booléens (par exemple pages.body.toc: {h4: true}). Les listes d’entrées, comme les menus, sont concaténées. Voir les listes.\nSurcharger avec des variables d’environnement\nToute clé de configuration peut être définie par une variable d’environnement préfixée par CECIL_, en majuscules. Les clés imbriquées sont séparées par un tiret bas (par exemple CECIL_OUTPUT_DIR définit output.dir) :\nexport CECIL_BASEURL=\"https:\/\/staging.example.com\/\"\nexport CECIL_DEBUG=true\nphp cecil.phar build\nChaque tiret bas étant converti en point, les clés qui contiennent un tiret bas (par exemple pages.body.images.dark_suffix) ne peuvent pas être définies par une variable d’environnement.\nCecil charge aussi un fichier .env à la racine du site, s’il existe (les variables déjà définies par le système sont conservées) :\nCECIL_TITLE=\"My site (preview)\"\nCECIL_DEBUG=true\nLes variables d’environnement sont appliquées en dernier, par-dessus les fichiers de configuration et les options de commande comme --baseurl, ce qui les rend pratiques en intégration continue (CI), par exemple :\n# .gitlab-ci.yml\npages:\n  variables:\n    CECIL_ENV: production\n    CECIL_OUTPUT_DIR: public\nLire l’environnement dans les templates\nUtilisez la fonction getenv pour adapter les templates, par exemple pour n’inclure les statistiques d’audience qu’en production :\n{% if getenv('CECIL_ENV') == 'production' %}\n  {{ include('partials\/analytics.html.twig') }}\n{% endif %}\nLa variable site.debug indique si le mode débogage est activé :\n{% if site.debug %}{{ dump(page) }}{% endif %}\nConsultez la documentation pour surcharger la configuration, l’option debug et la fonction getenv.",
      "content_html": "<p>Le site local et le site de production partagent rarement les mêmes réglages : URL de base, mode débogage, répertoire de sortie… Cecil permet de conserver un unique <code translate=\"no\">cecil.yml</code> et de le surcharger selon l’environnement.</p>\n<h2 id=\"garder-les-valeurs-de-production-dans-cecil-yml\">Garder les valeurs de production dans <code translate=\"no\">cecil.yml</code><a class=\"heading-anchor\" href=\"#garder-les-valeurs-de-production-dans-cecil-yml\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">\"My site\"</span>\n<span class=\"hljs-attr\">baseurl:</span> <span class=\"hljs-string\">https://example.com/</span>\n<span class=\"hljs-attr\">debug:</span> <span class=\"hljs-literal\">false</span></code></pre>\n<h2 id=\"surcharger-avec-des-fichiers-de-configuration-supplementaires\">Surcharger avec des fichiers de configuration supplémentaires<a class=\"heading-anchor\" href=\"#surcharger-avec-des-fichiers-de-configuration-supplementaires\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Créez un fichier contenant uniquement les clés à modifier, par exemple <code translate=\"no\">config/dev.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">debug:</span> <span class=\"hljs-literal\">true</span>\n<span class=\"hljs-attr\">cache:</span>\n  <span class=\"hljs-attr\">enabled:</span> <span class=\"hljs-literal\">false</span></code></pre>\n<p>Puis chargez-le avec l’option <code translate=\"no\">--config</code>, disponible avec les commandes <code translate=\"no\">build</code> et <code translate=\"no\">serve</code> :</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar serve --config=config/dev.yml</code></pre>\n<aside class=\"note note-info\"><p>Inutile de définir <code translate=\"no\">baseurl</code> pour la prévisualisation locale : la commande <code translate=\"no\">serve</code> génère le site avec sa propre URL locale (par exemple <code translate=\"no\">http://localhost:8000/</code>), sauf si la variable d’environnement <code translate=\"no\">CECIL_BASEURL</code> est définie, y compris dans un fichier <code translate=\"no\">.env</code> (voir ci-dessous).</p></aside>\n<p>Vous pouvez passer plusieurs fichiers, séparés par des virgules. Ils sont fusionnés dans l’ordre après <code translate=\"no\">cecil.yml</code> : chaque fichier surcharge donc les précédents.</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar build --config=config/prod.yml,config/local.yml</code></pre>\n<aside class=\"note note-warning\"><p>Les listes de valeurs sont remplacées, pas fusionnées : si <code translate=\"no\">cecil.yml</code> définit <code translate=\"no\">pages.body.toc: [h2, h3]</code> et qu’un fichier supplémentaire définit <code translate=\"no\">pages.body.toc: [h4]</code>, le résultat est <code translate=\"no\">[h4]</code>. Pour ajouter ou retirer une valeur, utilisez plutôt une table de booléens (par exemple <code translate=\"no\">pages.body.toc: {h4: true}</code>). Les listes d’entrées, comme les menus, sont concaténées. Voir les <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/#listes\">listes</a>.</p></aside>\n<h2 id=\"surcharger-avec-des-variables-d-environnement\">Surcharger avec des variables d’environnement<a class=\"heading-anchor\" href=\"#surcharger-avec-des-variables-d-environnement\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Toute clé de configuration peut être définie par une variable d’environnement préfixée par <code translate=\"no\">CECIL_</code>, en majuscules. Les clés imbriquées sont séparées par un tiret bas (par exemple <code translate=\"no\">CECIL_OUTPUT_DIR</code> définit <code translate=\"no\">output.dir</code>) :</p>\n<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://staging.example.com/\"</span>\n<span class=\"hljs-built_in\">export</span> CECIL_DEBUG=<span class=\"hljs-literal\">true</span>\nphp cecil.phar build</code></pre>\n<aside class=\"note note-info\"><p>Chaque tiret bas étant converti en point, les clés qui contiennent un tiret bas (par exemple <code translate=\"no\">pages.body.images.dark_suffix</code>) ne peuvent pas être définies par une variable d’environnement.</p></aside>\n<p>Cecil charge aussi un fichier <code translate=\"no\">.env</code> à la racine du site, s’il existe (les variables déjà définies par le système sont conservées) :</p>\n<pre data-lang=\"dotenv\"><code class=\"language-dotenv\" translate=\"no\">CECIL_TITLE=\"My site (preview)\"\nCECIL_DEBUG=true</code></pre>\n<p>Les variables d’environnement sont appliquées en dernier, par-dessus les fichiers de configuration <strong>et</strong> les options de commande comme <code translate=\"no\">--baseurl</code>, ce qui les rend pratiques en intégration continue (CI), par exemple :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-comment\"># .gitlab-ci.yml</span>\n<span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">variables:</span>\n    <span class=\"hljs-attr\">CECIL_ENV:</span> <span class=\"hljs-string\">production</span>\n    <span class=\"hljs-attr\">CECIL_OUTPUT_DIR:</span> <span class=\"hljs-string\">public</span></code></pre>\n<h2 id=\"lire-l-environnement-dans-les-templates\">Lire l’environnement dans les templates<a class=\"heading-anchor\" href=\"#lire-l-environnement-dans-les-templates\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Utilisez la fonction <code translate=\"no\">getenv</code> pour adapter les templates, par exemple pour n’inclure les statistiques d’audience qu’en production :</p>\n<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> getenv('CECIL_ENV') == 'production' %}</span><span class=\"xml\">\n  </span><span class=\"hljs-template-variable\">{{ <span class=\"hljs-name\">include</span><span class=\"hljs-params\">('partials/analytics.html.twig')</span> }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span></code></pre>\n<p>La variable <code translate=\"no\">site.debug</code> indique si le mode débogage est activé :</p>\n<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> site.debug %}</span><span class=\"hljs-template-variable\">{{ <span class=\"hljs-name\">dump</span><span class=\"hljs-params\">(page)</span> }}</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span></code></pre>\n<aside class=\"note note-info\"><p>Consultez la documentation pour <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/surcharge/\">surcharger la configuration</a>, l’<a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/site/#debug\">option <code translate=\"no\">debug</code></a> et la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/fonctions/#getenv\">fonction <code translate=\"no\">getenv</code></a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-assets-scss/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-assets-scss/",
      "title": "Compiler, minifier et ajouter une empreinte aux fichiers CSS et JavaScript",
      "summary": "Traiter les fichiers Sass, CSS et JavaScript dans les templates Cecil avec la fonction asset et ses filtres.",
      "date_published": "2026-10-11T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Cecil peut compiler des fichiers Sass, minifier le CSS et le JavaScript, et ajouter une empreinte du contenu aux noms de fichiers (cache busting) directement depuis vos templates, sans outil de build externe.\nConfigurer le traitement des assets\nLes fichiers sources sont stockés dans le répertoire assets\/. Le traitement est activé par défaut et peut être ajusté dans cecil.yml :\nassets:\n  compile:\n    style: compressed                  # `expanded` (par défaut) ou `compressed`\n    import: [sass, scss, node_modules] # répertoires d’import (par défaut)\n  minify: true                         # minifie le CSS et le JS\n  fingerprint: true                    # ajoute l’empreinte du contenu aux noms de fichiers\nCharger une feuille de style\nCréez un asset à partir d’un fichier Sass et générez l’élément &lt;link&gt; avec la fonction html. Le fichier Sass est compilé en CSS, puis minifié et doté d’une empreinte selon la configuration :\n{{ html(asset('css\/styles.scss')) }}\nLes filtres peuvent être chaînés pour appliquer chaque étape explicitement, ce qui est utile si une fonctionnalité (comme minify ou fingerprint) est désactivée globalement :\n{{ asset('css\/styles.scss')|to_css|minify|fingerprint }}\nRegrouper des fichiers JavaScript\nPassez un tableau de chemins pour créer un bundle unique, avec un nom de fichier personnalisé :\n{{ html(asset(['js\/menu.js', 'js\/search.js'], {filename: 'scripts.js'})) }}\nLes options peuvent aussi être définies par asset, par exemple pour ne pas minifier un fichier distant déjà minifié :\n{{ html(asset('https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/anchor-js\/4.3.1\/anchor.min.js', {minify: false})) }}\nAjouter l’intégrité des sous-ressources\nUtilisez la fonction integrity (ou l’attribut integrity de l’asset) pour générer une empreinte (hash) sha384 :\n{% set styles = asset('css\/styles.scss') %}\n&lt;link rel=\"stylesheet\" href=\"{{ url(styles) }}\" integrity=\"{{ integrity(styles) }}\" crossorigin=\"anonymous\"&gt;\nIntégrer le CSS critique\nAffichez le contenu d’un asset avec le filtre inline :\n&lt;style&gt;{{ asset('css\/critical.scss')|to_css|minify|inline }}&lt;\/style&gt;\nPour quelques lignes de styles écrites directement dans le template, utilisez les filtres scss_to_css et minify_css :\n&lt;style&gt;\n{% apply scss_to_css|minify_css %}\n  $color: #fcfcfc;\n  body {\n    background-color: $color;\n  }\n{% endapply %}\n&lt;\/style&gt;\nConsultez la documentation de la fonction asset, de la fonction integrity, des filtres de traitement et de la configuration des assets.",
      "content_html": "<p>Cecil peut compiler des fichiers <a href=\"https://sass-lang.com\" target=\"_blank\" rel=\"noopener noreferrer\">Sass</a>, minifier le CSS et le JavaScript, et ajouter une empreinte du contenu aux noms de fichiers (<em>cache busting</em>) directement depuis vos templates, sans outil de build externe.</p>\n<h2 id=\"configurer-le-traitement-des-assets\">Configurer le traitement des assets<a class=\"heading-anchor\" href=\"#configurer-le-traitement-des-assets\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Les fichiers sources sont stockés dans le répertoire <code translate=\"no\">assets/</code>. Le traitement est activé par défaut et peut être ajusté dans <code translate=\"no\">cecil.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">assets:</span>\n  <span class=\"hljs-attr\">compile:</span>\n    <span class=\"hljs-attr\">style:</span> <span class=\"hljs-string\">compressed</span>                  <span class=\"hljs-comment\"># `expanded` (par défaut) ou `compressed`</span>\n    <span class=\"hljs-attr\">import:</span> <span class=\"hljs-string\">[sass,</span> <span class=\"hljs-string\">scss,</span> <span class=\"hljs-string\">node_modules]</span> <span class=\"hljs-comment\"># répertoires d’import (par défaut)</span>\n  <span class=\"hljs-attr\">minify:</span> <span class=\"hljs-literal\">true</span>                         <span class=\"hljs-comment\"># minifie le CSS et le JS</span>\n  <span class=\"hljs-attr\">fingerprint:</span> <span class=\"hljs-literal\">true</span>                    <span class=\"hljs-comment\"># ajoute l’empreinte du contenu aux noms de fichiers</span></code></pre>\n<h2 id=\"charger-une-feuille-de-style\">Charger une feuille de style<a class=\"heading-anchor\" href=\"#charger-une-feuille-de-style\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Créez un <em>asset</em> à partir d’un fichier Sass et générez l’élément <code translate=\"no\">&lt;link&gt;</code> avec la fonction <code translate=\"no\">html</code>. Le fichier Sass est compilé en CSS, puis minifié et doté d’une empreinte selon la configuration :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset('css/styles.scss')) }}</span></code></pre>\n<p>Les filtres peuvent être chaînés pour appliquer chaque étape explicitement, ce qui est utile si une fonctionnalité (comme <code translate=\"no\">minify</code> ou <code translate=\"no\">fingerprint</code>) est désactivée globalement :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ asset('css/styles.scss')|to_css|minify|fingerprint }}</span></code></pre>\n<h2 id=\"regrouper-des-fichiers-javascript\">Regrouper des fichiers JavaScript<a class=\"heading-anchor\" href=\"#regrouper-des-fichiers-javascript\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Passez un tableau de chemins pour créer un bundle unique, avec un nom de fichier personnalisé :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset(['js/menu.js', 'js/search.js'], {filename: 'scripts.js'})) }}</span></code></pre>\n<p>Les options peuvent aussi être définies par asset, par exemple pour ne pas minifier un fichier distant déjà minifié :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset('https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.3.1/anchor.<span class=\"hljs-name\">min</span>.js', {minify: false})) }}</span></code></pre>\n<h2 id=\"ajouter-l-integrite-des-sous-ressources\">Ajouter l’intégrité des sous-ressources<a class=\"heading-anchor\" href=\"#ajouter-l-integrite-des-sous-ressources\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Utilisez la fonction <code translate=\"no\">integrity</code> (ou l’attribut <code translate=\"no\">integrity</code> de l’asset) pour générer une empreinte (<em>hash</em>) <code translate=\"no\">sha384</code> :</p>\n<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 = asset('css/styles.scss') %}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">link</span> <span class=\"hljs-attr\">rel</span>=<span class=\"hljs-string\">\"stylesheet\"</span> <span class=\"hljs-attr\">href</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ url(styles) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span> <span class=\"hljs-attr\">integrity</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ integrity(styles) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span> <span class=\"hljs-attr\">crossorigin</span>=<span class=\"hljs-string\">\"anonymous\"</span>&gt;</span></span></code></pre>\n<h2 id=\"integrer-le-css-critique\">Intégrer le CSS critique<a class=\"heading-anchor\" href=\"#integrer-le-css-critique\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Affichez le contenu d’un asset avec le filtre <code translate=\"no\">inline</code> :</p>\n<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-variable\">{{ asset('css/critical.scss')|to_css|minify|inline }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">style</span>&gt;</span></span></code></pre>\n<p>Pour quelques lignes de styles écrites directement dans le template, utilisez les filtres <code translate=\"no\">scss_to_css</code> et <code translate=\"no\">minify_css</code> :</p>\n<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>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">apply</span></span> scss_to_css|minify_css %}</span><span class=\"xml\">\n  $color: #fcfcfc;\n  body {\n    background-color: $color;\n  }\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endapply</span></span> %}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">style</span>&gt;</span></span></code></pre>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/assets/#asset\">fonction <code translate=\"no\">asset</code></a>, de la <a href=\"https://cloudflare.cecil.app/fr/documentation/assets/#integrity\">fonction <code translate=\"no\">integrity</code></a>, des <a href=\"https://cloudflare.cecil.app/fr/documentation/assets/traitements/\">filtres de traitement</a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/assets/\">configuration des assets</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/contenu-taxonomies/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/contenu-taxonomies/",
      "title": "Organiser les pages avec des tags et des catégories",
      "summary": "Classer les pages Cecil avec des taxonomies comme les tags et les catégories, et personnaliser leurs pages de liste.",
      "date_published": "2026-10-10T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Les taxonomies permettent de classer les pages avec des termes (par exemple PHP) regroupés dans des vocabulaires (par exemple tags). Cecil génère ensuite une page par vocabulaire et une page par terme.\nDéclarer les vocabulaires\nLes vocabulaires sont déclarés dans cecil.yml, par paires de noms au pluriel et au singulier :\ntaxonomies:\n  categories: category\n  tags: tag\nIl n’existe pas de vocabulaire par défaut : vous devez les déclarer pour les utiliser.\nClasser les pages\nAjoutez les termes dans le front matter de vos pages, en utilisant le nom au pluriel du vocabulaire :\n---\ntitle: Mon premier billet\ncategories: [\"Development\"]\ntags: [\"PHP\", \"Static site\"]\n---\nCecil génère :\n\n\/tags\/ : la liste des termes du vocabulaire\n\/tags\/php\/ et \/tags\/static-site\/ : la liste des pages de chaque terme\n\nPersonnaliser la liste des termes\nLe template de vocabulaire est nommé d’après le pluriel, par exemple layouts\/taxonomy\/tags.html.twig :\n{% extends 'page.html.twig' %}\n\n{% block content %}\n  &lt;h1&gt;{{ page.title }}&lt;\/h1&gt;\n  &lt;ul&gt;\n  {% for term in page.terms %}\n    &lt;li&gt;&lt;a href=\"{{ url(term.id, {language: site.language}) }}\"&gt;{{ term.name }}&lt;\/a&gt; ({{ term|length }})&lt;\/li&gt;\n  {% endfor %}\n  &lt;\/ul&gt;\n{% endblock %}\nPersonnaliser les pages d’un terme\nLe template de terme est nommé d’après le singulier, par exemple layouts\/taxonomy\/tag.html.twig :\n{% extends 'page.html.twig' %}\n\n{% block content %}\n  &lt;h1&gt;{{ page.title }}&lt;\/h1&gt;\n  {% for p in page.paginator.pages ?? page.pages %}\n    &lt;article&gt;\n      &lt;h2&gt;&lt;a href=\"{{ url(p) }}\"&gt;{{ p.title }}&lt;\/a&gt;&lt;\/h2&gt;\n    &lt;\/article&gt;\n  {% endfor %}\n  &lt;a href=\"{{ url(page.plural, {language: site.language}) }}\"&gt;All {{ page.plural }}&lt;\/a&gt;\n{% endblock %}\nAfficher les termes d’une page\nDans un template de page, liez chaque terme à sa page :\n{% for tag in page.tags ?? [] %}\n  &lt;a href=\"{{ url('tags\/' ~ tag, {language: site.language}) }}\"&gt;{{ tag }}&lt;\/a&gt;\n{% endfor %}\nL’option language conserve la langue courante dans les liens d’un site multilingue.\nOu utilisez le partial intégré : {{ include('partials\/terms-list.html.twig', {vocabulary: 'tags'}) }}.\nConsultez la documentation de la configuration des taxonomies, des règles de recherche des templates et des variables de taxonomie.",
      "content_html": "<p>Les taxonomies permettent de classer les pages avec des termes (par exemple <code translate=\"no\">PHP</code>) regroupés dans des vocabulaires (par exemple <code translate=\"no\">tags</code>). Cecil génère ensuite une page par vocabulaire et une page par terme.</p>\n<h2 id=\"declarer-les-vocabulaires\">Déclarer les vocabulaires<a class=\"heading-anchor\" href=\"#declarer-les-vocabulaires\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Les vocabulaires sont déclarés dans <code translate=\"no\">cecil.yml</code>, par paires de noms au pluriel et au singulier :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">taxonomies:</span>\n  <span class=\"hljs-attr\">categories:</span> <span class=\"hljs-string\">category</span>\n  <span class=\"hljs-attr\">tags:</span> <span class=\"hljs-string\">tag</span></code></pre>\n<aside class=\"note note-warning\"><p>Il n’existe pas de vocabulaire par défaut : vous devez les déclarer pour les utiliser.</p></aside>\n<h2 id=\"classer-les-pages\">Classer les pages<a class=\"heading-anchor\" href=\"#classer-les-pages\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez les termes dans le front matter de vos pages, en utilisant le nom au pluriel du vocabulaire :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Mon</span> <span class=\"hljs-string\">premier</span> <span class=\"hljs-string\">billet</span>\n<span class=\"hljs-attr\">categories:</span> <span class=\"hljs-string\">[\"Development\"]</span>\n<span class=\"hljs-attr\">tags:</span> <span class=\"hljs-string\">[\"PHP\",</span> <span class=\"hljs-string\">\"Static site\"</span><span class=\"hljs-string\">]</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<p>Cecil génère :</p>\n<ul>\n<li><code translate=\"no\">/tags/</code> : la liste des termes du vocabulaire</li>\n<li><code translate=\"no\">/tags/php/</code> et <code translate=\"no\">/tags/static-site/</code> : la liste des pages de chaque terme</li>\n</ul>\n<h2 id=\"personnaliser-la-liste-des-termes\">Personnaliser la liste des termes<a class=\"heading-anchor\" href=\"#personnaliser-la-liste-des-termes\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Le template de <em>vocabulaire</em> est nommé d’après le <strong>pluriel</strong>, par exemple <code translate=\"no\">layouts/taxonomy/tags.html.twig</code> :</p>\n<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\">\n\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">block</span></span> content %}</span><span class=\"xml\">\n  <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>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul</span>&gt;</span>\n  </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\">\n    <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, {language: site.language}) }}</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>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">ul</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endblock</span></span> %}</span></code></pre>\n<h2 id=\"personnaliser-les-pages-d-un-terme\">Personnaliser les pages d’un terme<a class=\"heading-anchor\" href=\"#personnaliser-les-pages-d-un-terme\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Le template de <em>terme</em> est nommé d’après le <strong>singulier</strong>, par exemple <code translate=\"no\">layouts/taxonomy/tag.html.twig</code> :</p>\n<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\">\n\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">block</span></span> content %}</span><span class=\"xml\">\n  <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>\n  </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\">\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">article</span>&gt;</span>\n      <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>\n    <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">article</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span><span class=\"xml\">\n  <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, {language: site.language}) }}</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>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endblock</span></span> %}</span></code></pre>\n<h2 id=\"afficher-les-termes-d-une-page\">Afficher les termes d’une page<a class=\"heading-anchor\" href=\"#afficher-les-termes-d-une-page\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Dans un template de page, liez chaque terme à sa page :</p>\n<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> tag in page.tags ?? [] %}</span><span class=\"xml\">\n  <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('tags/' ~ tag, {language: site.language}) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ tag }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span></code></pre>\n<p>L’option <code translate=\"no\">language</code> conserve la langue courante dans les liens d’un site multilingue.</p>\n<p>Ou utilisez le partial intégré : <code translate=\"no\">{{ include('partials/terms-list.html.twig', {vocabulary: 'tags'}) }}</code>.</p>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/site/#taxonomies\">configuration des taxonomies</a>, des <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/regles-de-recherche/#type-vocabulary\">règles de recherche des templates</a> et des <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/variables/#taxonomie\">variables de taxonomie</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-menus/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-menus/",
      "title": "Construire un menu de navigation",
      "summary": "Déclarer des menus dans la configuration ou le front matter de Cecil et les afficher dans les templates.",
      "date_published": "2026-10-09T00:00:00+00:00",
      "date_modified": "2026-10-18T00:00:00+00:00","content_text": "Cecil gère les menus de navigation comme des collections d’entrées (nom, URL, poids) que vous pouvez déclarer dans la configuration ou directement dans les pages, puis afficher n’importe où dans vos templates.\nDéclarer des entrées dans la configuration\nAjoutez une section menus dans cecil.yml. Chaque menu (ex. : main, footer) est une liste d’entrées avec un id unique :\nmenus:\n  main:\n    - id: about\n      name: \"About\"\n      url: \/about\/\n      weight: 1\n  footer:\n    - id: github\n      name: \"GitHub\"\n      url: https:\/\/github.com\/Cecilapp\/Cecil\n      weight: 99\nUn menu main est automatiquement créé avec l’entrée de la page d’accueil et celles des sections de premier niveau (sauf si elles définissent leur propre variable menu).\nAjouter une page depuis son front matter\nUne page peut s’ajouter à un ou plusieurs menus avec la variable menu. Le nom de l’entrée est le title de la page et l’URL est son chemin :\n---\ntitle: Our Expertise\nmenu:\n  main:\n    weight: 15\n  footer:\n    weight: 15\n    name: \"Expertise\" # surcharge le nom de l’entrée dans ce menu\n---\nSurcharger ou désactiver une entrée\nUtilisez l’ID de la page comme id pour surcharger une entrée existante, ou enabled: false pour la retirer :\nmenus:\n  main:\n    - id: index\n      name: \"Home\"\n      weight: 1\n    - id: about\n      enabled: false\nAfficher le menu\nBouclez sur site.menus.&lt;menu&gt;, trié par poids, et comparez l’ID de chaque entrée avec celui de la page courante pour mettre en évidence l’élément actif :\n&lt;nav&gt;\n  &lt;ul&gt;\n  {% for entry in site.menus.main|sort_by_weight %}\n    &lt;li&gt;\n      &lt;a href=\"{{ url(entry.url) }}\"{% if entry.id == page.id %} aria-current=\"page\" class=\"active\"{% endif %}&gt;{{ entry.name }}&lt;\/a&gt;\n    &lt;\/li&gt;\n  {% endfor %}\n  &lt;\/ul&gt;\n&lt;\/nav&gt;\nL’ID de l’entrée d’une page n’inclut pas le préfixe de langue (ex. : about pour la page fr\/about), contrairement à page.id. Sur un site multilingue, comparez plutôt les URL : {% if url(entry.url) == url(page) %}.\nUne entrée peut aussi être atteinte directement par son ID :\n{% if site.menus.main.about is defined %}\n  &lt;a href=\"{{ url(site.menus.main.about.url) }}\"&gt;{{ site.menus.main.about.name }}&lt;\/a&gt;\n{% endif %}\nCecil fournit également un partial intégré, sans mise en évidence de l’élément actif : {{ include('partials\/navigation.html.twig', {menu: 'main'}) }}.\nConsultez la documentation de la configuration des menus, de la variable de front matter menu et de la variable site.menus.",
      "content_html": "<p>Cecil gère les menus de navigation comme des collections d’entrées (nom, URL, poids) que vous pouvez déclarer dans la configuration ou directement dans les pages, puis afficher n’importe où dans vos templates.</p>\n<h2 id=\"declarer-des-entrees-dans-la-configuration\">Déclarer des entrées dans la configuration<a class=\"heading-anchor\" href=\"#declarer-des-entrees-dans-la-configuration\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez une section <code translate=\"no\">menus</code> dans <code translate=\"no\">cecil.yml</code>. Chaque menu (ex. : <code translate=\"no\">main</code>, <code translate=\"no\">footer</code>) est une liste d’entrées avec un <code translate=\"no\">id</code> unique :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">menus:</span>\n  <span class=\"hljs-attr\">main:</span>\n    <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">id:</span> <span class=\"hljs-string\">about</span>\n      <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">\"About\"</span>\n      <span class=\"hljs-attr\">url:</span> <span class=\"hljs-string\">/about/</span>\n      <span class=\"hljs-attr\">weight:</span> <span class=\"hljs-number\">1</span>\n  <span class=\"hljs-attr\">footer:</span>\n    <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">id:</span> <span class=\"hljs-string\">github</span>\n      <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">\"GitHub\"</span>\n      <span class=\"hljs-attr\">url:</span> <span class=\"hljs-string\">https://github.com/Cecilapp/Cecil</span>\n      <span class=\"hljs-attr\">weight:</span> <span class=\"hljs-number\">99</span></code></pre>\n<aside class=\"note note-info\"><p>Un menu <code translate=\"no\">main</code> est automatiquement créé avec l’entrée de la page d’accueil et celles des sections de premier niveau (sauf si elles définissent leur propre variable <code translate=\"no\">menu</code>).</p></aside>\n<h2 id=\"ajouter-une-page-depuis-son-front-matter\">Ajouter une page depuis son front matter<a class=\"heading-anchor\" href=\"#ajouter-une-page-depuis-son-front-matter\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Une page peut s’ajouter à un ou plusieurs menus avec la variable <code translate=\"no\">menu</code>. Le nom de l’entrée est le <code translate=\"no\">title</code> de la page et l’URL est son chemin :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Our</span> <span class=\"hljs-string\">Expertise</span>\n<span class=\"hljs-attr\">menu:</span>\n  <span class=\"hljs-attr\">main:</span>\n    <span class=\"hljs-attr\">weight:</span> <span class=\"hljs-number\">15</span>\n  <span class=\"hljs-attr\">footer:</span>\n    <span class=\"hljs-attr\">weight:</span> <span class=\"hljs-number\">15</span>\n    <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">\"Expertise\"</span> <span class=\"hljs-comment\"># surcharge le nom de l’entrée dans ce menu</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<h2 id=\"surcharger-ou-desactiver-une-entree\">Surcharger ou désactiver une entrée<a class=\"heading-anchor\" href=\"#surcharger-ou-desactiver-une-entree\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Utilisez l’ID de la page comme <code translate=\"no\">id</code> pour surcharger une entrée existante, ou <code translate=\"no\">enabled: false</code> pour la retirer :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">menus:</span>\n  <span class=\"hljs-attr\">main:</span>\n    <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">id:</span> <span class=\"hljs-string\">index</span>\n      <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">\"Home\"</span>\n      <span class=\"hljs-attr\">weight:</span> <span class=\"hljs-number\">1</span>\n    <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">id:</span> <span class=\"hljs-string\">about</span>\n      <span class=\"hljs-attr\">enabled:</span> <span class=\"hljs-literal\">false</span></code></pre>\n<h2 id=\"afficher-le-menu\">Afficher le menu<a class=\"heading-anchor\" href=\"#afficher-le-menu\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Bouclez sur <code translate=\"no\">site.menus.&lt;menu&gt;</code>, trié par poids, et comparez l’ID de chaque entrée avec celui de la page courante pour mettre en évidence l’élément actif :</p>\n<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>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul</span>&gt;</span>\n  </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\">\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li</span>&gt;</span>\n      <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></span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">if</span></span> entry.id == page.id %}</span><span class=\"xml\"><span class=\"hljs-tag\"> <span class=\"hljs-attr\">aria-current</span>=<span class=\"hljs-string\">\"page\"</span> <span class=\"hljs-attr\">class</span>=<span class=\"hljs-string\">\"active\"</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\">{{ entry.name }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n    <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">li</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">ul</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">nav</span>&gt;</span></span></code></pre>\n<aside class=\"note note-important\"><p>L’ID de l’entrée d’une page n’inclut pas le préfixe de langue (ex. : <code translate=\"no\">about</code> pour la page <code translate=\"no\">fr/about</code>), contrairement à <code translate=\"no\">page.id</code>. Sur un site multilingue, comparez plutôt les URL : <code translate=\"no\">{% if url(entry.url) == url(page) %}</code>.</p></aside>\n<p>Une entrée peut aussi être atteinte directement par son ID :</p>\n<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> site.menus.main.about is defined %}</span><span class=\"xml\">\n  <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.menus.main.about.url) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ site.menus.main.about.name }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span></code></pre>\n<aside class=\"note note-tip\"><p>Cecil fournit également un partial intégré, sans mise en évidence de l’élément actif : <code translate=\"no\">{{ include('partials/navigation.html.twig', {menu: 'main'}) }}</code>.</p></aside>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/site/#menus\">configuration des menus</a>, de la <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#menu\">variable de front matter <code translate=\"no\">menu</code></a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/variables/#site-menus\">variable <code translate=\"no\">site.menus</code></a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/sortie-index-de-recherche/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/sortie-index-de-recherche/",
      "title": "Ajouter une recherche côté client",
      "summary": "Ajouter une recherche côté client à un site statique Cecil avec un index JSON des pages et une petite bibliothèque JavaScript.",
      "date_published": "2026-10-08T00:00:00+00:00",
      "date_modified": "2026-10-20T00:00:00+00:00","content_text": "Un site statique n’a pas de recherche côté serveur, mais Cecil peut générer un index JSON de vos pages au moment de la génération. Quelques lignes de JavaScript suffisent ensuite pour l’interroger dans le navigateur.\nCréer la page d’index\nCréez une page dont le seul format de sortie est json, avec un layout dédié :\npages\/search.md\n---\ntitle: Search index\nlayout: search\noutput: json\nexcluded: true\n---\nexcluded: true exclut cette page technique des pages de liste et du sitemap.\nÉcrire le template JSON\nSelon les règles de recherche, Cecil génère cette page avec layouts\/search.json.twig. Construisez un tableau des pages affichables (showable), puis encodez-le :\n{%- set index = [] -%}\n{%- for p in site.pages.showable|filter(p =&gt; p.type == 'page') -%}\n  {%- set index = index|merge([{\n    title: p.title,\n    url: url(p),\n    description: p.description|default(''),\n    content: p.content|striptags|excerpt(300)\n  }]) -%}\n{%- endfor -%}\n{{ index|json_encode(constant('JSON_UNESCAPED_UNICODE') b-or constant('JSON_UNESCAPED_SLASHES'))|raw }}\nAprès php cecil.phar build, l’index est disponible à l’adresse \/search.json.\nsite.pages.showable inclut aussi les pages sans fichier de contenu : le filtre p.type == 'page' écarte les sections et les taxonomies de l’index, mais les pages créées par un générateur ou déclarées dans pages.default sont indexées, sauf si elles ont excluded: true.\nRechercher avec Fuse.js\nAjoutez un champ de recherche dans un template et chargez Fuse.js depuis un CDN pour interroger l’index :\n&lt;input type=\"search\" id=\"search\" placeholder=\"Rechercher…\"&gt;\n&lt;ul id=\"results\"&gt;&lt;\/ul&gt;\n\n&lt;script type=\"module\"&gt;\n  import Fuse from 'https:\/\/cdn.jsdelivr.net\/npm\/fuse.js@7\/dist\/fuse.mjs';\n\n  const index = await fetch('{{ url('search', {format: 'json'}) }}').then(r =&gt; r.json());\n  const fuse = new Fuse(index, { keys: ['title', 'description', 'content'], threshold: 0.3 });\n  const results = document.getElementById('results');\n\n  document.getElementById('search').addEventListener('input', (e) =&gt; {\n    results.replaceChildren(...fuse.search(e.target.value, { limit: 10 }).map(({ item }) =&gt; {\n      const li = document.createElement('li');\n      const a = document.createElement('a');\n      a.href = item.url;\n      a.textContent = item.title;\n      li.append(a);\n      return li;\n    }));\n  });\n&lt;\/script&gt;\nAlternative : Pagefind\nPagefind indexe directement les fichiers HTML générés : aucun template JSON n’est nécessaire. Lancez-le après la génération, sur le répertoire de sortie (_site par défaut) :\nphp cecil.phar build\nnpx pagefind --site _site\nChargez ensuite son interface dans un template :\n&lt;link href=\"\/pagefind\/pagefind-ui.css\" rel=\"stylesheet\"&gt;\n&lt;script src=\"\/pagefind\/pagefind-ui.js\"&gt;&lt;\/script&gt;\n&lt;div id=\"search\"&gt;&lt;\/div&gt;\n&lt;script&gt;\n  window.addEventListener('DOMContentLoaded', () =&gt; new PagefindUI({ element: '#search' }));\n&lt;\/script&gt;\nL’index est une page comme les autres : pour ne régénérer que les sorties JSON, déclarez un sous-ensemble et lancez php cecil.phar build --render-subset=&lt;name&gt;.\nConsultez la documentation de la variable output, des formats de sortie et de la fonction url.",
      "content_html": "<p>Un site statique n’a pas de recherche côté serveur, mais Cecil peut générer un <strong>index JSON de vos pages</strong> au moment de la génération. Quelques lignes de JavaScript suffisent ensuite pour l’interroger dans le navigateur.</p>\n<h2 id=\"creer-la-page-d-index\">Créer la page d’index<a class=\"heading-anchor\" href=\"#creer-la-page-d-index\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Créez une page dont le seul <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#output\">format de sortie</a> est <code translate=\"no\">json</code>, avec un layout dédié :</p>\n<p><em>pages/search.md</em></p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Search</span> <span class=\"hljs-string\">index</span>\n<span class=\"hljs-attr\">layout:</span> <span class=\"hljs-string\">search</span>\n<span class=\"hljs-attr\">output:</span> <span class=\"hljs-string\">json</span>\n<span class=\"hljs-attr\">excluded:</span> <span class=\"hljs-literal\">true</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<p><a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#excluded\"><code translate=\"no\">excluded: true</code></a> exclut cette page technique des pages de liste et du sitemap.</p>\n<h2 id=\"ecrire-le-template-json\">Écrire le template JSON<a class=\"heading-anchor\" href=\"#ecrire-le-template-json\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Selon les <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/regles-de-recherche/#regles-de-recherche\">règles de recherche</a>, Cecil génère cette page avec <code translate=\"no\">layouts/search.json.twig</code>. Construisez un tableau des pages <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/variables/#site\">affichables</a> (<em>showable</em>), puis encodez-le :</p>\n<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> index = [] -%}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{%- <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> p in site.pages.showable|<span class=\"hljs-keyword\">filter</span>(p =&gt; p.type == 'page') -%}</span><span class=\"xml\">\n  </span><span class=\"hljs-template-tag\">{%- <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> index = index|<span class=\"hljs-keyword\">merge</span>([{\n    title: p.title,\n    url: url(p),\n    description: p.description|<span class=\"hljs-keyword\">default</span>(''),\n    content: p.content|<span class=\"hljs-keyword\">striptags</span>|excerpt(300)\n  }]) -%}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{%- <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> -%}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ index|<span class=\"hljs-keyword\">json_encode</span>(<span class=\"hljs-name\">constant</span><span class=\"hljs-params\">('JSON_UNESCAPED_UNICODE')</span> b-or <span class=\"hljs-name\">constant</span><span class=\"hljs-params\">('JSON_UNESCAPED_SLASHES')</span>)|<span class=\"hljs-keyword\">raw</span> }}</span></code></pre>\n<p>Après <code translate=\"no\">php cecil.phar build</code>, l’index est disponible à l’adresse <code translate=\"no\">/search.json</code>.</p>\n<aside class=\"note note-info\"><p><code translate=\"no\">site.pages.showable</code> inclut aussi les pages sans fichier de contenu : le filtre <code translate=\"no\">p.type == 'page'</code> écarte les sections et les taxonomies de l’index, mais les pages créées par un générateur ou déclarées dans <code translate=\"no\">pages.default</code> sont indexées, sauf si elles ont <code translate=\"no\">excluded: true</code>.</p></aside>\n<h2 id=\"rechercher-avec-fuse-js\">Rechercher avec Fuse.js<a class=\"heading-anchor\" href=\"#rechercher-avec-fuse-js\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Ajoutez un champ de recherche dans un template et chargez <a href=\"https://www.fusejs.io\" target=\"_blank\" rel=\"noopener noreferrer\">Fuse.js</a> depuis un CDN pour interroger l’index :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input</span> <span class=\"hljs-attr\">type</span>=<span class=\"hljs-string\">\"search\"</span> <span class=\"hljs-attr\">id</span>=<span class=\"hljs-string\">\"search\"</span> <span class=\"hljs-attr\">placeholder</span>=<span class=\"hljs-string\">\"Rechercher…\"</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul</span> <span class=\"hljs-attr\">id</span>=<span class=\"hljs-string\">\"results\"</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">ul</span>&gt;</span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script</span> <span class=\"hljs-attr\">type</span>=<span class=\"hljs-string\">\"module\"</span>&gt;</span><span class=\"javascript\">\n  <span class=\"hljs-keyword\">import</span> Fuse <span class=\"hljs-keyword\">from</span> <span class=\"hljs-string\">'https://cdn.jsdelivr.net/npm/fuse.js@7/dist/fuse.mjs'</span>;\n\n  <span class=\"hljs-keyword\">const</span> index = <span class=\"hljs-keyword\">await</span> fetch(<span class=\"hljs-string\">'</span></span></span><span class=\"hljs-template-variable\">{{ url('search', {format: 'json'}) }}</span><span class=\"xml\">').then(r =&gt; r.json());\n  const fuse = new Fuse(index, { keys: ['title', 'description', 'content'], threshold: 0.3 });\n  const results = document.getElementById('results');\n\n  document.getElementById('search').addEventListener('input', (e) =&gt; {\n    results.replaceChildren(...fuse.search(e.target.value, { limit: 10 }).map(({ item }) =&gt; {\n      const li = document.createElement('li');\n      const a = document.createElement('a');\n      a.href = item.url;\n      a.textContent = item.title;\n      li.append(a);\n      return li;\n    }));\n  });\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">script</span>&gt;</span></span></code></pre>\n<h2 id=\"alternative-pagefind\">Alternative : Pagefind<a class=\"heading-anchor\" href=\"#alternative-pagefind\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p><a href=\"https://pagefind.app\" target=\"_blank\" rel=\"noopener noreferrer\">Pagefind</a> indexe directement les fichiers HTML générés : aucun template JSON n’est nécessaire. Lancez-le après la génération, sur le répertoire de sortie (<code translate=\"no\">_site</code> par défaut) :</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar build\nnpx pagefind --site _site</code></pre>\n<p>Chargez ensuite son interface dans un template :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">link</span> <span class=\"hljs-attr\">href</span>=<span class=\"hljs-string\">\"/pagefind/pagefind-ui.css\"</span> <span class=\"hljs-attr\">rel</span>=<span class=\"hljs-string\">\"stylesheet\"</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script</span> <span class=\"hljs-attr\">src</span>=<span class=\"hljs-string\">\"/pagefind/pagefind-ui.js\"</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">script</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div</span> <span class=\"hljs-attr\">id</span>=<span class=\"hljs-string\">\"search\"</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">div</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script</span>&gt;</span><span class=\"javascript\">\n  <span class=\"hljs-built_in\">window</span>.addEventListener(<span class=\"hljs-string\">'DOMContentLoaded'</span>, () =&gt; <span class=\"hljs-keyword\">new</span> PagefindUI({ <span class=\"hljs-attr\">element</span>: <span class=\"hljs-string\">'#search'</span> }));\n</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">script</span>&gt;</span></span></code></pre>\n<aside class=\"note note-tip\"><p>L’index est une page comme les autres : pour ne régénérer que les sorties JSON, déclarez un <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-subsets\">sous-ensemble</a> et lancez <code translate=\"no\">php cecil.phar build --render-subset=&lt;name&gt;</code>.</p></aside>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#output\">variable <code translate=\"no\">output</code></a>, des <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/sortie/#output-formats\">formats de sortie</a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/fonctions/#url\">fonction <code translate=\"no\">url</code></a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/deploiement-github-pages/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/deploiement-github-pages/",
      "title": "Déployer sur GitHub Pages avec GitHub Actions",
      "summary": "Générer et déployer automatiquement un site Cecil sur GitHub Pages avec l’action GitHub de Cecil.",
      "date_published": "2026-10-07T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Avec l’action Cecil, chaque push sur votre dépôt génère le site et le publie sur GitHub Pages, sans serveur à gérer.\nActiver GitHub Pages\nDans votre dépôt, allez dans Settings → Pages puis, dans Build and deployment, choisissez GitHub Actions comme Source.\nAjouter le workflow\nCréez le fichier .github\/workflows\/build-and-deploy.yml :\nname: Build and deploy to GitHub Pages\non:\n  push:\n    branches: [master, main]\n  workflow_dispatch:\nconcurrency:\n  group: pages\n  cancel-in-progress: true\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout source\n        uses: actions\/checkout@v7\n      - name: Build site\n        uses: Cecilapp\/Action@v4\n  deploy:\n    needs: build\n    permissions:\n      pages: write\n      id-token: write\n    environment:\n      name: github-pages\n      url: ${{ steps.deployment.outputs.page_url }}\n    runs-on: ubuntu-latest\n    steps:\n      - name: Deploy to GitHub Pages\n        id: deployment\n        uses: actions\/deploy-pages@v5\nLe job build télécharge Cecil, installe les thèmes (si un fichier composer.json existe), génère le site et envoie le répertoire de sortie en tant qu’artefact Pages. Le job deploy le publie ensuite.\nURL de base\nInutile de modifier baseurl dans cecil.yml : l’action génère le site avec l’URL fournie par GitHub Pages (par exemple https:\/\/&lt;user&gt;.github.io\/&lt;repository&gt;\/), via l’option --baseurl.\nPersonnaliser la génération\nL’action accepte les paramètres optionnels suivants :\n      - name: Build site\n        uses: Cecilapp\/Action@v4\n        with:\n          path: docs             # répertoire du site, relatif à la racine du dépôt (`.` par défaut)\n          version: '9.13.0'      # version de Cecil (la dernière par défaut)\n          install_themes: 'no'   # ne pas installer les thèmes (`yes` par défaut)\n          options: '-v --drafts' # options de la commande build (`-v` par défaut)\nL’action envoie le répertoire _site du site, ou celui indiqué par l’option --output (-o) dans options : elle ne lit pas output.dir dans cecil.yml. Si vous changez le répertoire de sortie, passez-le dans options, par exemple options: '-v --output=public'.\nPour accélérer la génération, vous pouvez aussi restaurer et sauvegarder le répertoire .cache entre deux exécutions : consultez le workflow complet dans la documentation du déploiement sur GitHub Pages, ainsi que la liste des options de génération.",
      "content_html": "<p>Avec l’<a href=\"https://github.com/Cecilapp/Action\" target=\"_blank\" rel=\"noopener noreferrer\">action Cecil</a>, chaque push sur votre dépôt génère le site et le publie sur <strong>GitHub Pages</strong>, sans serveur à gérer.</p>\n<h2 id=\"activer-github-pages\">Activer GitHub Pages<a class=\"heading-anchor\" href=\"#activer-github-pages\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Dans votre dépôt, allez dans <strong>Settings</strong> → <strong>Pages</strong> puis, dans <strong>Build and deployment</strong>, choisissez <strong>GitHub Actions</strong> comme <strong>Source</strong>.</p>\n<h2 id=\"ajouter-le-workflow\">Ajouter le workflow<a class=\"heading-anchor\" href=\"#ajouter-le-workflow\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Créez le fichier <code translate=\"no\">.github/workflows/build-and-deploy.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml 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>\n<span class=\"hljs-attr\">on:</span>\n  <span class=\"hljs-attr\">push:</span>\n    <span class=\"hljs-attr\">branches:</span> <span class=\"hljs-string\">[master,</span> <span class=\"hljs-string\">main]</span>\n  <span class=\"hljs-attr\">workflow_dispatch:</span>\n<span class=\"hljs-attr\">concurrency:</span>\n  <span class=\"hljs-attr\">group:</span> <span class=\"hljs-string\">pages</span>\n  <span class=\"hljs-attr\">cancel-in-progress:</span> <span class=\"hljs-literal\">true</span>\n<span class=\"hljs-attr\">jobs:</span>\n  <span class=\"hljs-attr\">build:</span>\n    <span class=\"hljs-attr\">runs-on:</span> <span class=\"hljs-string\">ubuntu-latest</span>\n    <span class=\"hljs-attr\">steps:</span>\n      <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">Checkout</span> <span class=\"hljs-string\">source</span>\n        <span class=\"hljs-attr\">uses:</span> <span class=\"hljs-string\">actions/checkout@v7</span>\n      <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">Build</span> <span class=\"hljs-string\">site</span>\n        <span class=\"hljs-attr\">uses:</span> <span class=\"hljs-string\">Cecilapp/Action@v4</span>\n  <span class=\"hljs-attr\">deploy:</span>\n    <span class=\"hljs-attr\">needs:</span> <span class=\"hljs-string\">build</span>\n    <span class=\"hljs-attr\">permissions:</span>\n      <span class=\"hljs-attr\">pages:</span> <span class=\"hljs-string\">write</span>\n      <span class=\"hljs-attr\">id-token:</span> <span class=\"hljs-string\">write</span>\n    <span class=\"hljs-attr\">environment:</span>\n      <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">github-pages</span>\n      <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>\n    <span class=\"hljs-attr\">runs-on:</span> <span class=\"hljs-string\">ubuntu-latest</span>\n    <span class=\"hljs-attr\">steps:</span>\n      <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>\n        <span class=\"hljs-attr\">id:</span> <span class=\"hljs-string\">deployment</span>\n        <span class=\"hljs-attr\">uses:</span> <span class=\"hljs-string\">actions/deploy-pages@v5</span></code></pre>\n<p>Le job <code translate=\"no\">build</code> télécharge Cecil, installe les thèmes (si un fichier <code translate=\"no\">composer.json</code> existe), génère le site et envoie le répertoire de sortie en tant qu’artefact Pages. Le job <code translate=\"no\">deploy</code> le publie ensuite.</p>\n<h2 id=\"url-de-base\">URL de base<a class=\"heading-anchor\" href=\"#url-de-base\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Inutile de modifier <code translate=\"no\">baseurl</code> dans <code translate=\"no\">cecil.yml</code> : l’action génère le site avec l’URL fournie par GitHub Pages (par exemple <code translate=\"no\">https://&lt;user&gt;.github.io/&lt;repository&gt;/</code>), via l’option <code translate=\"no\">--baseurl</code>.</p>\n<h2 id=\"personnaliser-la-generation\">Personnaliser la génération<a class=\"heading-anchor\" href=\"#personnaliser-la-generation\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>L’action accepte les paramètres optionnels suivants :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\">      <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">Build</span> <span class=\"hljs-string\">site</span>\n        <span class=\"hljs-attr\">uses:</span> <span class=\"hljs-string\">Cecilapp/Action@v4</span>\n        <span class=\"hljs-attr\">with:</span>\n          <span class=\"hljs-attr\">path:</span> <span class=\"hljs-string\">docs</span>             <span class=\"hljs-comment\"># répertoire du site, relatif à la racine du dépôt (`.` par défaut)</span>\n          <span class=\"hljs-attr\">version:</span> <span class=\"hljs-string\">'9.13.0'</span>      <span class=\"hljs-comment\"># version de Cecil (la dernière par défaut)</span>\n          <span class=\"hljs-attr\">install_themes:</span> <span class=\"hljs-string\">'no'</span>   <span class=\"hljs-comment\"># ne pas installer les thèmes (`yes` par défaut)</span>\n          <span class=\"hljs-attr\">options:</span> <span class=\"hljs-string\">'-v --drafts'</span> <span class=\"hljs-comment\"># options de la commande build (`-v` par défaut)</span></code></pre>\n<aside class=\"note note-warning\"><p>L’action envoie le répertoire <code translate=\"no\">_site</code> du site, ou celui indiqué par l’option <code translate=\"no\">--output</code> (<code translate=\"no\">-o</code>) dans <code translate=\"no\">options</code> : elle ne lit pas <code translate=\"no\">output.dir</code> dans <code translate=\"no\">cecil.yml</code>. Si vous changez le répertoire de sortie, passez-le dans <code translate=\"no\">options</code>, par exemple <code translate=\"no\">options: '-v --output=public'</code>.</p></aside>\n<aside class=\"note note-tip\"><p>Pour accélérer la génération, vous pouvez aussi restaurer et sauvegarder le répertoire <code translate=\"no\">.cache</code> entre deux exécutions : consultez le workflow complet dans la <a href=\"https://cloudflare.cecil.app/fr/documentation/deployer/deploiement-continu/#github-pages\">documentation du déploiement sur GitHub Pages</a>, ainsi que la liste des <a href=\"https://cloudflare.cecil.app/fr/documentation/commandes/build/\">options de génération</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/sortie-flux-rss-json/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/sortie-flux-rss-json/",
      "title": "Publier un flux RSS ou JSON",
      "summary": "Publier des flux RSS, Atom ou JSON de votre site Cecil avec les formats de sortie et les templates intégrés.",
      "date_published": "2026-10-06T00:00:00+00:00",
      "date_modified": "2026-10-18T00:00:00+00:00","content_text": "Cecil génère les flux grâce aux formats de sortie : par défaut, la page d’accueil, les sections et les termes de taxonomie sont déjà publiés en HTML et en Atom (par exemple \/atom.xml, \/blog\/atom.xml). Ajoutez les formats rss ou jsonfeed pour publier aussi des fichiers RSS 2.0 ou JSON Feed.\nActiver les flux pour toutes les pages de liste\nDéfinissez les formats appliqués à chaque type de page avec output.pagetypeformats :\noutput:\n  pagetypeformats:\n    homepage: [html, atom, rss, jsonfeed]\n    section: [html, atom, rss, jsonfeed]\nCecil génère alors rss.xml et feed.json à côté de chaque index.html de la page d’accueil et des sections (par exemple \/blog\/rss.xml, \/blog\/feed.json).\nLa liste remplace les formats par défaut : conservez-y html et atom. Pour seulement ajouter des formats à ceux par défaut, utilisez plutôt une table de booléens :\noutput:\n  pagetypeformats:\n    homepage: {rss: true, jsonfeed: true}\n    section: {rss: true, jsonfeed: true}\nVoir les listes, output.pagetypeformats et la liste des formats par défaut.\nActiver un flux pour une seule section\nPour publier un flux pour une seule section, utilisez la variable output dans le front matter de la page d’index de la section. Comme elle remplace les formats par défaut de la section, conservez atom dans la liste pour garder le flux Atom :\n---\ntitle: Blog\noutput: [html, atom, rss]\n---\nSignaler le flux\nSi vos templates incluent le partial metatags (voir la configuration metatags), les balises &lt;link rel=\"alternate\"&gt; pointant vers les flux de la page courante sont ajoutées automatiquement dans le &lt;head&gt;.\nSinon, ajoutez le lien vous-même avec la fonction url() et son option format :\n&lt;link rel=\"alternate\" type=\"application\/rss+xml\" title=\"{{ site.title }}\" href=\"{{ url(page, {canonical: true, format: 'rss'}) }}\"&gt;\nPersonnaliser le template du flux\nLes flux sont générés par les templates intégrés _default\/list.rss.twig, _default\/list.atom.twig et _default\/list.jsonfeed.twig. Selon les règles de recherche, créez layouts\/list.rss.twig (page d’accueil et sections) ou layouts\/blog\/list.rss.twig (section blog uniquement) pour les surcharger.\nVous pouvez étendre le template intégré et redéfinir uniquement le bloc item, par exemple pour publier un extrait plutôt que le contenu complet :\n{% extends '_default\/list.rss.twig' %}\n\n{% block item %}\n      &lt;guid&gt;{{ url(item, {canonical: true}) }}&lt;\/guid&gt;\n      &lt;title&gt;{{ item.title|e }}&lt;\/title&gt;\n      &lt;pubDate&gt;{{ item.date|date('r') }}&lt;\/pubDate&gt;\n      &lt;link&gt;{{ url(item, {canonical: true}) }}&lt;\/link&gt;\n      &lt;description&gt;&lt;![CDATA[{{ item.content|excerpt_html }}]]&gt;&lt;\/description&gt;\n{% endblock %}\nDéfinissez baseurl dans cecil.yml : les flux utilisent des URL absolues.\nLe flux RSS peut aussi être mis en forme dans les navigateurs en activant la page par défaut xsl\/rss :\npages:\n  default:\n    xsl\/rss:\n      published: true",
      "content_html": "<p>Cecil génère les flux grâce aux <strong>formats de sortie</strong> : par défaut, la page d’accueil, les sections et les termes de taxonomie sont déjà publiés en HTML <strong>et en Atom</strong> (par exemple <code translate=\"no\">/atom.xml</code>, <code translate=\"no\">/blog/atom.xml</code>). Ajoutez les formats <code translate=\"no\">rss</code> ou <code translate=\"no\">jsonfeed</code> pour publier aussi des fichiers RSS 2.0 ou <a href=\"https://www.jsonfeed.org\" target=\"_blank\" rel=\"noopener noreferrer\">JSON Feed</a>.</p>\n<h2 id=\"activer-les-flux-pour-toutes-les-pages-de-liste\">Activer les flux pour toutes les pages de liste<a class=\"heading-anchor\" href=\"#activer-les-flux-pour-toutes-les-pages-de-liste\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Définissez les formats appliqués à chaque type de page avec <code translate=\"no\">output.pagetypeformats</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">output:</span>\n  <span class=\"hljs-attr\">pagetypeformats:</span>\n    <span class=\"hljs-attr\">homepage:</span> <span class=\"hljs-string\">[html,</span> <span class=\"hljs-string\">atom,</span> <span class=\"hljs-string\">rss,</span> <span class=\"hljs-string\">jsonfeed]</span>\n    <span class=\"hljs-attr\">section:</span> <span class=\"hljs-string\">[html,</span> <span class=\"hljs-string\">atom,</span> <span class=\"hljs-string\">rss,</span> <span class=\"hljs-string\">jsonfeed]</span></code></pre>\n<p>Cecil génère alors <code translate=\"no\">rss.xml</code> et <code translate=\"no\">feed.json</code> à côté de chaque <code translate=\"no\">index.html</code> de la page d’accueil et des sections (par exemple <code translate=\"no\">/blog/rss.xml</code>, <code translate=\"no\">/blog/feed.json</code>).</p>\n<p>La liste remplace les formats par défaut : conservez-y <code translate=\"no\">html</code> et <code translate=\"no\">atom</code>. Pour seulement ajouter des formats à ceux par défaut, utilisez plutôt une table de booléens :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">output:</span>\n  <span class=\"hljs-attr\">pagetypeformats:</span>\n    <span class=\"hljs-attr\">homepage:</span> <span class=\"hljs-string\">{rss:</span> <span class=\"hljs-literal\">true</span><span class=\"hljs-string\">,</span> <span class=\"hljs-attr\">jsonfeed:</span> <span class=\"hljs-literal\">true</span><span class=\"hljs-string\">}</span>\n    <span class=\"hljs-attr\">section:</span> <span class=\"hljs-string\">{rss:</span> <span class=\"hljs-literal\">true</span><span class=\"hljs-string\">,</span> <span class=\"hljs-attr\">jsonfeed:</span> <span class=\"hljs-literal\">true</span><span class=\"hljs-string\">}</span></code></pre>\n<aside class=\"note note-info\"><p>Voir les <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/#listes\">listes</a>, <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/sortie/#output-pagetypeformats\"><code translate=\"no\">output.pagetypeformats</code></a> et la liste des <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/sortie/#formats-par-defaut\">formats par défaut</a>.</p></aside>\n<h2 id=\"activer-un-flux-pour-une-seule-section\">Activer un flux pour une seule section<a class=\"heading-anchor\" href=\"#activer-un-flux-pour-une-seule-section\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Pour publier un flux pour une seule section, utilisez la variable <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/front-matter/#output\"><code translate=\"no\">output</code></a> dans le front matter de la page d’index de la section. Comme elle remplace les formats par défaut de la section, conservez <code translate=\"no\">atom</code> dans la liste pour garder le flux Atom :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Blog</span>\n<span class=\"hljs-attr\">output:</span> <span class=\"hljs-string\">[html,</span> <span class=\"hljs-string\">atom,</span> <span class=\"hljs-string\">rss]</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<h2 id=\"signaler-le-flux\">Signaler le flux<a class=\"heading-anchor\" href=\"#signaler-le-flux\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Si vos templates incluent le <a href=\"https://cloudflare.cecil.app/fr/comment-faire/templates-metatags/\">partial metatags</a> (voir la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/site/#metatags\">configuration <code translate=\"no\">metatags</code></a>), les balises <code translate=\"no\">&lt;link rel=\"alternate\"&gt;</code> pointant vers les flux de la page courante sont ajoutées automatiquement dans le <code translate=\"no\">&lt;head&gt;</code>.</p>\n<p>Sinon, ajoutez le lien vous-même avec la fonction <code translate=\"no\">url()</code> et son option <code translate=\"no\">format</code> :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">link</span> <span class=\"hljs-attr\">rel</span>=<span class=\"hljs-string\">\"alternate\"</span> <span class=\"hljs-attr\">type</span>=<span class=\"hljs-string\">\"application/rss+xml\"</span> <span class=\"hljs-attr\">title</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ site.title }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span> <span class=\"hljs-attr\">href</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ url(page, {canonical: true, format: 'rss'}) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span></code></pre>\n<h2 id=\"personnaliser-le-template-du-flux\">Personnaliser le template du flux<a class=\"heading-anchor\" href=\"#personnaliser-le-template-du-flux\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Les flux sont générés par les <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/regles-de-recherche/#templates-integres\">templates intégrés</a> <code translate=\"no\">_default/list.rss.twig</code>, <code translate=\"no\">_default/list.atom.twig</code> et <code translate=\"no\">_default/list.jsonfeed.twig</code>. Selon les <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/regles-de-recherche/#regles-de-recherche\">règles de recherche</a>, créez <code translate=\"no\">layouts/list.rss.twig</code> (page d’accueil et sections) ou <code translate=\"no\">layouts/blog/list.rss.twig</code> (section <code translate=\"no\">blog</code> uniquement) pour les surcharger.</p>\n<p>Vous pouvez étendre le template intégré et redéfinir uniquement le bloc <code translate=\"no\">item</code>, par exemple pour publier un extrait plutôt que le contenu complet :</p>\n<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> '_default/list.rss.twig' %}</span><span class=\"xml\">\n\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">block</span></span> item %}</span><span class=\"xml\">\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">guid</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ url(item, {canonical: true}) }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">guid</span>&gt;</span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">title</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ item.title|e }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">title</span>&gt;</span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">pubDate</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ item.<span class=\"hljs-name\">date</span>|<span class=\"hljs-keyword\">date</span>('r') }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">pubDate</span>&gt;</span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">link</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ url(item, {canonical: true}) }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">link</span>&gt;</span>\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">description</span>&gt;</span>&lt;![CDATA[</span><span class=\"hljs-template-variable\">{{ item.content|excerpt_html }}</span><span class=\"xml\">]]&gt;<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">description</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endblock</span></span> %}</span></code></pre>\n<aside class=\"note note-tip\"><p>Définissez <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/site/#baseurl\"><code translate=\"no\">baseurl</code></a> dans <code translate=\"no\">cecil.yml</code> : les flux utilisent des URL absolues.</p>\n<p>Le flux RSS peut aussi être mis en forme dans les navigateurs en activant la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-default\">page par défaut</a> <code translate=\"no\">xsl/rss</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">default:</span>\n    <span class=\"hljs-attr\">xsl/rss:</span>\n      <span class=\"hljs-attr\">published:</span> <span class=\"hljs-literal\">true</span></code></pre></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-pagination/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-pagination/",
      "title": "Paginer une liste de pages",
      "summary": "Découper les longues listes de pages (blog, sections, taxonomies) en plusieurs pages avec la pagination de Cecil.",
      "date_published": "2026-10-05T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Lorsqu’une section contient de nombreuses pages, Cecil peut découper sa liste en plusieurs pages (ex. : \/blog\/, \/blog\/page\/2\/, \/blog\/page\/3\/, etc.) et fournit un paginator pour construire les liens de navigation.\nConfigurer la pagination\nLa pagination est activée par défaut pour les pages de liste (homepage, section et term), avec 5 entrées par page. Modifiez-la dans cecil.yml :\npages:\n  pagination:\n    max: 10    # nombre maximum d’entrées par page\n    path: page # chemin des pages paginées\nLa surcharger pour une section\nDéfinissez la variable pagination dans le front matter du fichier index de la section (ex. : pages\/blog\/index.md) :\n---\ntitle: Blog\npagination:\n  max: 20\n---\nOu désactivez-la pour cette section uniquement :\n---\npagination: false\n---\nAfficher les pages paginées\nLe paginator n’existe que lorsque la liste contient plus de pages que max. Lorsque la pagination est désactivée, ou lorsque toutes les pages tiennent sur une seule page, page.paginator est vide.\nDans le template de liste (ex. : layouts\/blog\/list.html.twig), bouclez sur page.paginator.pages et utilisez page.pages.showable en l’absence de paginator :\n{% for p in page.paginator.pages ?? page.pages.showable %}\n  &lt;article&gt;\n    &lt;h2&gt;&lt;a href=\"{{ url(p) }}\"&gt;{{ p.title }}&lt;\/a&gt;&lt;\/h2&gt;\n    &lt;time datetime=\"{{ p.date|date('c') }}\"&gt;{{ p.date|date('j M Y') }}&lt;\/time&gt;\n  &lt;\/article&gt;\n{% endfor %}\nAjouter les liens de navigation\nLes liens du paginator sont des identifiants de pages : utilisez la fonction url() pour créer des liens fonctionnels. Le test {% if page.paginator %} masque la navigation en l’absence de paginator :\n{% if page.paginator %}\n&lt;nav&gt;\n  {% if page.paginator.links.prev is defined %}\n  &lt;a href=\"{{ url(page.paginator.links.prev) }}\" rel=\"prev\"&gt;Previous&lt;\/a&gt;\n  {% endif %}\n  &lt;span&gt;Page {{ page.paginator.current }} of {{ page.paginator.count }}&lt;\/span&gt;\n  {% if page.paginator.links.next is defined %}\n  &lt;a href=\"{{ url(page.paginator.links.next) }}\" rel=\"next\"&gt;Next&lt;\/a&gt;\n  {% endif %}\n&lt;\/nav&gt;\n{% endif %}\nPour lister tous les numéros de page, itérez de 1 à page.paginator.count :\n{% if page.paginator %}\n&lt;nav&gt;\n  {% for i in 1..page.paginator.count %}\n    {% if i == page.paginator.current %}\n  &lt;span aria-current=\"page\"&gt;{{ i }}&lt;\/span&gt;\n    {% elseif i == 1 %}\n  &lt;a href=\"{{ url(page.paginator.links.first) }}\"&gt;{{ i }}&lt;\/a&gt;\n    {% else %}\n  &lt;a href=\"{{ url(page.paginator.links.path ~ '\/' ~ i) }}\"&gt;{{ i }}&lt;\/a&gt;\n    {% endif %}\n  {% endfor %}\n&lt;\/nav&gt;\n{% endif %}\nConsultez la documentation de la variable page.paginator, de la configuration de la pagination et de la variable pagination des sections.",
      "content_html": "<p>Lorsqu’une section contient de nombreuses pages, Cecil peut découper sa liste en plusieurs pages (ex. : <code translate=\"no\">/blog/</code>, <code translate=\"no\">/blog/page/2/</code>, <code translate=\"no\">/blog/page/3/</code>, etc.) et fournit un <em>paginator</em> pour construire les liens de navigation.</p>\n<h2 id=\"configurer-la-pagination\">Configurer la pagination<a class=\"heading-anchor\" href=\"#configurer-la-pagination\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>La pagination est activée par défaut pour les pages de liste (<em>homepage</em>, <em>section</em> et <em>term</em>), avec 5 entrées par page. Modifiez-la dans <code translate=\"no\">cecil.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">pagination:</span>\n    <span class=\"hljs-attr\">max:</span> <span class=\"hljs-number\">10</span>    <span class=\"hljs-comment\"># nombre maximum d’entrées par page</span>\n    <span class=\"hljs-attr\">path:</span> <span class=\"hljs-string\">page</span> <span class=\"hljs-comment\"># chemin des pages paginées</span></code></pre>\n<h2 id=\"la-surcharger-pour-une-section\">La surcharger pour une section<a class=\"heading-anchor\" href=\"#la-surcharger-pour-une-section\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Définissez la variable <code translate=\"no\">pagination</code> dans le front matter du fichier index de la section (ex. : <code translate=\"no\">pages/blog/index.md</code>) :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">Blog</span>\n<span class=\"hljs-attr\">pagination:</span>\n  <span class=\"hljs-attr\">max:</span> <span class=\"hljs-number\">20</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<p>Ou désactivez-la pour cette section uniquement :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">pagination:</span> <span class=\"hljs-literal\">false</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<h2 id=\"afficher-les-pages-paginees\">Afficher les pages paginées<a class=\"heading-anchor\" href=\"#afficher-les-pages-paginees\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Le <em>paginator</em> n’existe que lorsque la liste contient plus de pages que <code translate=\"no\">max</code>. Lorsque la pagination est désactivée, ou lorsque toutes les pages tiennent sur une seule page, <code translate=\"no\">page.paginator</code> est vide.</p>\n<p>Dans le template de liste (ex. : <code translate=\"no\">layouts/blog/list.html.twig</code>), bouclez sur <code translate=\"no\">page.paginator.pages</code> et utilisez <code translate=\"no\">page.pages.showable</code> en l’absence de <em>paginator</em> :</p>\n<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 page.paginator.pages ?? page.pages.showable %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">article</span>&gt;</span>\n    <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>\n    <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\">{{ p.<span class=\"hljs-name\">date</span>|<span class=\"hljs-keyword\">date</span>('c') }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ p.<span class=\"hljs-name\">date</span>|<span class=\"hljs-keyword\">date</span>('j M Y') }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">time</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">article</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span></code></pre>\n<h2 id=\"ajouter-les-liens-de-navigation\">Ajouter les liens de navigation<a class=\"heading-anchor\" href=\"#ajouter-les-liens-de-navigation\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Les liens du <em>paginator</em> sont des identifiants de pages : utilisez la fonction <code translate=\"no\">url()</code> pour créer des liens fonctionnels. Le test <code translate=\"no\">{% if page.paginator %}</code> masque la navigation en l’absence de <em>paginator</em> :</p>\n<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\">\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">nav</span>&gt;</span>\n  </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\">\n  <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> <span class=\"hljs-attr\">rel</span>=<span class=\"hljs-string\">\"prev\"</span>&gt;</span>Previous<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span</span>&gt;</span>Page </span><span class=\"hljs-template-variable\">{{ page.paginator.current }}</span><span class=\"xml\"> of </span><span class=\"hljs-template-variable\">{{ page.paginator.count }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">span</span>&gt;</span>\n  </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\">\n  <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> <span class=\"hljs-attr\">rel</span>=<span class=\"hljs-string\">\"next\"</span>&gt;</span>Next<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">nav</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span></code></pre>\n<p>Pour lister tous les numéros de page, itérez de <code translate=\"no\">1</code> à <code translate=\"no\">page.paginator.count</code> :</p>\n<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\">\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">nav</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> i in 1..page.paginator.count %}</span><span class=\"xml\">\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">if</span></span> i == page.paginator.current %}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span</span> <span class=\"hljs-attr\">aria-current</span>=<span class=\"hljs-string\">\"page\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ i }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">span</span>&gt;</span>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">elseif</span> i == 1 %}</span><span class=\"xml\">\n  <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\">{{ i }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">else</span> %}</span><span class=\"xml\">\n  <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 ~ '/' ~ i) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ i }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span><span class=\"xml\">\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span><span class=\"xml\">\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">nav</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span></code></pre>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/variables/#page-paginator\">variable <code translate=\"no\">page.paginator</code></a>, de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-pagination\">configuration de la pagination</a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/pages/#pagination\">variable <code translate=\"no\">pagination</code> des sections</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/contenu-multilingue/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/contenu-multilingue/",
      "title": "Traduire un site en plusieurs langues",
      "summary": "Traduire les pages, la configuration et les textes des templates d’un site Cecil en plusieurs langues.",
      "date_published": "2026-10-04T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Cecil gère nativement les sites multilingues : il suffit de déclarer les langues, d’ajouter les pages traduites, puis de les relier entre elles et de traduire les templates.\nDéclarer les langues\nDéfinissez la langue principale et la liste des langues disponibles dans cecil.yml :\nlanguage: en\nlanguages:\n  - code: en\n    name: English\n    locale: en_US\n  - code: fr\n    name: Français\n    locale: fr_FR\n    config:\n      title: \"Mon site en français\"\nLes options placées sous la clé config d’une langue remplacent les options globales (ici le title du site).\nTraduire une page\nDupliquez la page de référence et suffixez son nom de fichier avec le code de la langue :\npages\/\n├─ about.md    # la page de référence\n└─ about.fr.md # la version française\nUtilisez la variable slug pour traduire l’URL de la page :\n---\ntitle: À propos\nslug: a-propos\n---\nabout.md est publiée sur \/about\/ et about.fr.md sur \/fr\/a-propos\/.\nPour créer une page qui n’existe que dans une autre langue (sans être une traduction), définissez language: fr dans son front matter.\nRelier les pages traduites\nChaque page expose ses traductions via page.translations. Ajoutez un sélecteur de langue à votre template :\n{% for p in page.translations %}\n  &lt;a href=\"{{ url(p) }}\" hreflang=\"{{ p.language }}\"&gt;{{ site.language.name(p.language) }}&lt;\/a&gt;\n{% endfor %}\nVous pouvez aussi inclure le partial intégré : {{ include('partials\/languages.html.twig') }}.\nLes traductions sont reliées par la variable langref, qui est déduite par défaut du chemin du fichier. Pour relier des pages dont les chemins diffèrent, définissez le même langref dans leur front matter (par exemple langref: about).\nTraduire les textes des templates\nEncadrez les textes avec la balise ou le filtre trans :\n{% trans %}Read more{% endtrans %}\n{{ 'Read more'|trans }}\nAjoutez ensuite un fichier de traduction nommé d’après la locale de la langue dans le dossier translations :\n# translations\/messages.fr_FR.yaml\nRead more: Lire la suite\nExtrayez les textes de vos templates avec :\nphp cecil.phar util:translations:extract --locale=fr_FR --save\nConsultez la documentation du contenu multilingue, de la configuration des langues et de la localisation des templates.",
      "content_html": "<p>Cecil gère nativement les sites multilingues : il suffit de déclarer les langues, d’ajouter les pages traduites, puis de les relier entre elles et de traduire les templates.</p>\n<h2 id=\"declarer-les-langues\">Déclarer les langues<a class=\"heading-anchor\" href=\"#declarer-les-langues\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Définissez la langue principale et la liste des langues disponibles dans <code translate=\"no\">cecil.yml</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">language:</span> <span class=\"hljs-string\">en</span>\n<span class=\"hljs-attr\">languages:</span>\n  <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">code:</span> <span class=\"hljs-string\">en</span>\n    <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">English</span>\n    <span class=\"hljs-attr\">locale:</span> <span class=\"hljs-string\">en_US</span>\n  <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">code:</span> <span class=\"hljs-string\">fr</span>\n    <span class=\"hljs-attr\">name:</span> <span class=\"hljs-string\">Français</span>\n    <span class=\"hljs-attr\">locale:</span> <span class=\"hljs-string\">fr_FR</span>\n    <span class=\"hljs-attr\">config:</span>\n      <span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">\"Mon site en français\"</span></code></pre>\n<p>Les options placées sous la clé <code translate=\"no\">config</code> d’une langue remplacent les options globales (ici le <code translate=\"no\">title</code> du site).</p>\n<h2 id=\"traduire-une-page\">Traduire une page<a class=\"heading-anchor\" href=\"#traduire-une-page\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Dupliquez la page de référence et suffixez son nom de fichier avec le code de la langue :</p>\n<pre data-lang=\"plaintext\"><code class=\"language-plaintext hljs plaintext\" translate=\"no\">pages/\n├─ about.md    # la page de référence\n└─ about.fr.md # la version française</code></pre>\n<p>Utilisez la variable <code translate=\"no\">slug</code> pour traduire l’URL de la page :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">À</span> <span class=\"hljs-string\">propos</span>\n<span class=\"hljs-attr\">slug:</span> <span class=\"hljs-string\">a-propos</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<p><code translate=\"no\">about.md</code> est publiée sur <code translate=\"no\">/about/</code> et <code translate=\"no\">about.fr.md</code> sur <code translate=\"no\">/fr/a-propos/</code>.</p>\n<aside class=\"note note-tip\"><p>Pour créer une page qui n’existe que dans une autre langue (sans être une traduction), définissez <code translate=\"no\">language: fr</code> dans son front matter.</p></aside>\n<h2 id=\"relier-les-pages-traduites\">Relier les pages traduites<a class=\"heading-anchor\" href=\"#relier-les-pages-traduites\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Chaque page expose ses traductions via <code translate=\"no\">page.translations</code>. Ajoutez un sélecteur de langue à votre template :</p>\n<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 page.translations %}</span><span class=\"xml\">\n  <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> <span class=\"hljs-attr\">hreflang</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ p.language }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ site.language.name(p.language) }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span></code></pre>\n<p>Vous pouvez aussi inclure le partial intégré : <code translate=\"no\">{{ include('partials/languages.html.twig') }}</code>.</p>\n<aside class=\"note note-tip\"><p>Les traductions sont reliées par la variable <code translate=\"no\">langref</code>, qui est déduite par défaut du chemin du fichier. Pour relier des pages dont les chemins diffèrent, définissez le même <code translate=\"no\">langref</code> dans leur front matter (par exemple <code translate=\"no\">langref: about</code>).</p></aside>\n<h2 id=\"traduire-les-textes-des-templates\">Traduire les textes des templates<a class=\"heading-anchor\" href=\"#traduire-les-textes-des-templates\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Encadrez les textes avec la balise ou le filtre <code translate=\"no\">trans</code> :</p>\n<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\">Read more</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endtrans</span> %}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ 'Read more'|trans }}</span></code></pre>\n<p>Ajoutez ensuite un fichier de traduction nommé d’après la locale de la langue dans le dossier <code translate=\"no\">translations</code> :</p>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-comment\"># translations/messages.fr_FR.yaml</span>\n<span class=\"hljs-attr\">Read more:</span> <span class=\"hljs-string\">Lire</span> <span class=\"hljs-string\">la</span> <span class=\"hljs-string\">suite</span></code></pre>\n<p>Extrayez les textes de vos templates avec :</p>\n<pre data-lang=\"bash\"><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar util:translations:extract --locale=fr_FR --save</code></pre>\n<aside class=\"note note-info\"><p>Consultez la documentation du <a href=\"https://cloudflare.cecil.app/fr/documentation/contenu/multilingue/\">contenu multilingue</a>, de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/langues/#languages\">configuration des langues</a> et de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/localisation/\">localisation des templates</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-metatags/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-metatags/",
      "title": "Appliquer les fonctionnalités SEO dans les templates",
      "summary": "Ajouter les fonctionnalités SEO de Cecil aux templates avec le partial metatags.",
      "date_published": "2026-06-09T00:00:00+00:00",
      "date_modified": "2026-10-18T00:00:00+00:00","content_text": "Cecil expose ses fonctionnalités SEO via le template partials\/metatags.html.twig. Il suffit de l’inclure dans le &lt;head&gt; du template de base pour que chaque page bénéficie automatiquement du titre, des balises meta, des liens canoniques et des cartes sociales. Les données structurées (JSON-LD) peuvent aussi être ajoutées, en passant l’option metatags.data à true.\n&lt;html lang=\"{{ site.language }}\"&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"utf-8\"&gt;\n    {{ include('partials\/metatags.html.twig') }}\n  &lt;\/head&gt;\n  &lt;body&gt;\n    ...\n  &lt;\/body&gt;\n&lt;\/html&gt;\nLe partial génère déjà l’élément &lt;title&gt; : n’ajoutez pas le vôtre.\nLe partial lit d’abord le front matter de la page, puis reprend la configuration du site si nécessaire. Consultez la documentation de configuration des metatags pour voir toutes les options disponibles.\nSi vous devez surcharger le titre ou l’image par défaut, passez des valeurs directement au partial (image accepte un chemin de fichier ou un asset) :\n{{ include('partials\/metatags.html.twig', {title: 'Custom title', image: 'images\/social-card.png'}) }}",
      "content_html": "<p>Cecil expose ses fonctionnalités SEO via le template <code translate=\"no\">partials/metatags.html.twig</code>. Il suffit de l’inclure dans le <code translate=\"no\">&lt;head&gt;</code> du template de base pour que chaque page bénéficie automatiquement <strong>du titre, des balises meta, des liens canoniques et des cartes sociales</strong>. Les données structurées (JSON-LD) peuvent aussi être ajoutées, en passant l’option <code translate=\"no\">metatags.data</code> à <code translate=\"no\">true</code>.</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">html</span> <span class=\"hljs-attr\">lang</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ site.language }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">head</span>&gt;</span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta</span> <span class=\"hljs-attr\">charset</span>=<span class=\"hljs-string\">\"utf-8\"</span>&gt;</span>\n    </span><span class=\"hljs-template-variable\">{{ <span class=\"hljs-name\">include</span><span class=\"hljs-params\">('partials/metatags.html.twig')</span> }}</span><span class=\"xml\">\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">head</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body</span>&gt;</span>\n    ...\n  <span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">body</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">html</span>&gt;</span></span></code></pre>\n<aside class=\"note note-important\"><p>Le partial génère déjà l’élément <code translate=\"no\">&lt;title&gt;</code> : n’ajoutez pas le vôtre.</p></aside>\n<p>Le partial lit d’abord le front matter de la page, puis reprend la configuration du site si nécessaire. Consultez la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/site/#metatags\">documentation de configuration des metatags</a> pour voir toutes les options disponibles.</p>\n<p>Si vous devez surcharger le titre ou l’image par défaut, passez des valeurs directement au partial (<code translate=\"no\">image</code> accepte un chemin de fichier ou un asset) :</p>\n<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/social-card.png'})</span> }}</span></code></pre>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-image-formats/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-image-formats/",
      "title": "Générer plusieurs formats d’image dans les templates",
      "summary": "Générer des formats d’image AVIF et WebP dans les templates Cecil.",
      "date_published": "2025-07-25T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Pour optimiser les performances et la bande passante, Cecil peut générer plusieurs formats d’une image, tels qu’AVIF et WebP. Cela permet au navigateur de sélectionner le format le plus adapté à ses capacités :\n{{ html(asset('image.jpg'), attributes={alt: 'Description alternative'}, options={formats: ['avif', 'webp']}) }}\nAVIF et WebP sont des formats d’image qui offrent une meilleure compression que JPEG et PNG à qualité égale : les images se chargent plus vite et consomment moins de données. Ils sont pris en charge par tous les navigateurs modernes (Chrome, Edge, Firefox, Safari et Opera) ; l’image d’origine est conservée comme solution de repli pour les plus anciens.\nLes formats alternatifs peuvent être activés pour toutes les images générées avec html grâce à l’option layouts.images.formats.\nExemple\nVoici un exemple de génération des formats AVIF et WebP d’une image :\n{{ html(asset('cecil-logo.png'), attributes={alt: 'Cecil logo'}, options={formats: ['avif', 'webp']}) }}\nHTML généré\n&lt;picture&gt;\n  &lt;source type=\"image\/avif\" srcset=\"\/cecil-logo.c1af8a129a0cde81f9b94ffbf452e10b.avif\"&gt;\n  &lt;source type=\"image\/webp\" srcset=\"\/cecil-logo.c1af8a129a0cde81f9b94ffbf452e10b.webp\"&gt;\n  &lt;img src=\"\/cecil-logo.c1af8a129a0cde81f9b94ffbf452e10b.png\" alt=\"Cecil logo\" width=\"250\" height=\"250\"&gt;\n&lt;\/picture&gt;\nConsultez la documentation de la fonction html.",
      "content_html": "<p>Pour optimiser les performances et la bande passante, Cecil peut générer plusieurs formats d’une image, tels qu’AVIF et WebP. Cela permet au navigateur de sélectionner le format le plus adapté à ses capacités :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset('image.jpg'), attributes={alt: 'Description alternative'}, options={formats: ['avif', 'webp']}) }}</span></code></pre>\n<p>AVIF et WebP sont des formats d’image qui offrent une meilleure compression que JPEG et PNG à qualité égale : les images se chargent plus vite et consomment moins de données. Ils sont pris en charge par tous les navigateurs modernes (Chrome, Edge, Firefox, Safari et Opera) ; l’image d’origine est conservée comme solution de repli pour les plus anciens.</p>\n<aside class=\"note note-tip\"><p>Les formats alternatifs peuvent être activés pour toutes les images générées avec <code translate=\"no\">html</code> grâce à l’<a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/layouts/#layouts-images\">option <code translate=\"no\">layouts.images.formats</code></a>.</p></aside>\n<h2 id=\"exemple\">Exemple<a class=\"heading-anchor\" href=\"#exemple\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Voici un exemple de génération des formats AVIF et WebP d’une image :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset('cecil-logo.png'), attributes={alt: 'Cecil logo'}, options={formats: ['avif', 'webp']}) }}</span></code></pre>\n<h3 id=\"html-genere\">HTML généré<a class=\"heading-anchor\" href=\"#html-genere\" aria-hidden=\"true\" tabindex=\"-1\"></a></h3>\n<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>\n  <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\">\"/cecil-logo.c1af8a129a0cde81f9b94ffbf452e10b.avif\"</span>&gt;</span>\n  <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\">\"/cecil-logo.c1af8a129a0cde81f9b94ffbf452e10b.webp\"</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img</span> <span class=\"hljs-attr\">src</span>=<span class=\"hljs-string\">\"/cecil-logo.c1af8a129a0cde81f9b94ffbf452e10b.png\"</span> <span class=\"hljs-attr\">alt</span>=<span class=\"hljs-string\">\"Cecil logo\"</span> <span class=\"hljs-attr\">width</span>=<span class=\"hljs-string\">\"250\"</span> <span class=\"hljs-attr\">height</span>=<span class=\"hljs-string\">\"250\"</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">picture</span>&gt;</span></code></pre>\n<aside class=\"note note-info\"><p>Consultez la documentation de la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/fonctions/#html\">fonction <code translate=\"no\">html</code></a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/templates-responsive-images/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/templates-responsive-images/",
      "title": "Générer des images responsives dans les templates",
      "summary": "Générer des images responsives dans les templates Cecil avec la fonction html.",
      "date_published": "2025-07-25T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "Le moyen le plus simple de générer des images responsives dans les templates est d’utiliser la fonction html :\n{{ html(asset('image.jpg'), attributes={alt: 'Description alternative'}, options={responsive: true}) }}\nLes valeurs de largeur par défaut des images générées sont 480, 640, 768, 1024, 1366, 1600 et 1920. Elles peuvent être modifiées dans la section assets de la configuration.\nLes images responsives peuvent être activées pour toutes les images générées avec html grâce à l’option layouts.images.responsive. Utilisez responsive: 'density' pour générer des variantes selon la densité de pixels (1x, 2x, etc.) plutôt que selon la largeur.\nExemple\nVoici un exemple avec une image PNG de 1000×1000 pixels :\n{{ html(asset('cecil-logo-1000.png'), attributes={alt: 'Cecil logo'}, options={responsive: true}) }}\nConfiguration\nassets:\n  images:\n    responsive:\n      widths: [768, 1024]\nHTML généré\nReformaté pour plus de lisibilité :\n&lt;img\n  src=\"\/cecil-logo-1000.fbacb922cddbcdb7ca9a03a3ca3cf2ca.png\"\n  alt=\"Cecil logo\"\n  srcset=\"\/thumbnails\/768\/cecil-logo-1000.fbacb922cddbcdb7ca9a03a3ca3cf2ca.png 768w,\n          \/cecil-logo-1000.fbacb922cddbcdb7ca9a03a3ca3cf2ca.png 1000w\"\n  sizes=\"100vw\"\n  width=\"1000\"\n  height=\"1000\"\n&gt;",
      "content_html": "<p>Le moyen le plus simple de générer des <a href=\"https://developer.mozilla.org/fr/docs/Web/HTML/Guides/Responsive_images\" target=\"_blank\" rel=\"noopener noreferrer\">images responsives</a> dans les templates est d’utiliser la <a href=\"https://cloudflare.cecil.app/fr/documentation/templates/reference/fonctions/#html\">fonction <code translate=\"no\">html</code></a> :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset('image.jpg'), attributes={alt: 'Description alternative'}, options={responsive: true}) }}</span></code></pre>\n<aside class=\"note note-important\"><p>Les valeurs de largeur par défaut des images générées sont 480, 640, 768, 1024, 1366, 1600 et 1920. Elles peuvent être modifiées dans la section <em>assets</em> de la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/assets/#assets-images\">configuration</a>.</p></aside>\n<aside class=\"note note-tip\"><p>Les images responsives peuvent être activées pour toutes les images générées avec <code translate=\"no\">html</code> grâce à l’<a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/layouts/#layouts-images\">option <code translate=\"no\">layouts.images.responsive</code></a>. Utilisez <code translate=\"no\">responsive: 'density'</code> pour générer des variantes selon la densité de pixels (<code translate=\"no\">1x</code>, <code translate=\"no\">2x</code>, etc.) plutôt que selon la largeur.</p></aside>\n<h2 id=\"exemple\">Exemple<a class=\"heading-anchor\" href=\"#exemple\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Voici un exemple avec une image PNG de 1000×1000 pixels :</p>\n<pre data-lang=\"twig\"><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset('cecil-logo-1000.png'), attributes={alt: 'Cecil logo'}, options={responsive: true}) }}</span></code></pre>\n<h3 id=\"configuration\">Configuration<a class=\"heading-anchor\" href=\"#configuration\" aria-hidden=\"true\" tabindex=\"-1\"></a></h3>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">assets:</span>\n  <span class=\"hljs-attr\">images:</span>\n    <span class=\"hljs-attr\">responsive:</span>\n      <span class=\"hljs-attr\">widths:</span> <span class=\"hljs-string\">[768,</span> <span class=\"hljs-number\">1024</span><span class=\"hljs-string\">]</span></code></pre>\n<h3 id=\"html-genere\">HTML généré<a class=\"heading-anchor\" href=\"#html-genere\" aria-hidden=\"true\" tabindex=\"-1\"></a></h3>\n<p>Reformaté pour plus de lisibilité :</p>\n<pre data-lang=\"html\"><code class=\"language-html hljs xml\" translate=\"no\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img</span>\n  <span class=\"hljs-attr\">src</span>=<span class=\"hljs-string\">\"/cecil-logo-1000.fbacb922cddbcdb7ca9a03a3ca3cf2ca.png\"</span>\n  <span class=\"hljs-attr\">alt</span>=<span class=\"hljs-string\">\"Cecil logo\"</span>\n  <span class=\"hljs-attr\">srcset</span>=<span class=\"hljs-string\">\"/thumbnails/768/cecil-logo-1000.fbacb922cddbcdb7ca9a03a3ca3cf2ca.png 768w,\n          /cecil-logo-1000.fbacb922cddbcdb7ca9a03a3ca3cf2ca.png 1000w\"</span>\n  <span class=\"hljs-attr\">sizes</span>=<span class=\"hljs-string\">\"100vw\"</span>\n  <span class=\"hljs-attr\">width</span>=<span class=\"hljs-string\">\"1000\"</span>\n  <span class=\"hljs-attr\">height</span>=<span class=\"hljs-string\">\"1000\"</span>\n&gt;</span></code></pre>",
      "language": "fr"
    },
    {
      "id": "https://cloudflare.cecil.app/fr/comment-faire/markdown-performance-images/",
      "url": "https://cloudflare.cecil.app/fr/comment-faire/markdown-performance-images/",
      "title": "Optimiser les images dans Markdown",
      "summary": "Optimiser les images Markdown dans Cecil avec des tailles adaptatives, des formats modernes et le chargement différé.",
      "date_published": "2025-06-01T00:00:00+00:00",
      "date_modified": "2026-10-16T00:00:00+00:00","content_text": "L’optimisation des images est l’un des moyens les plus efficaces d’améliorer les performances de votre site web.\nCecil peut appliquer automatiquement les optimisations suivantes aux images Markdown (voir la configuration ci-dessous) :\n\nDimensions : les dimensions des images sont définies pour garantir une mise en page correcte et éviter les décalages\nCompression : l’image est compressée pour réduire la taille du fichier sans perte significative de qualité (nécessite assets.images.optimize: true et l’installation des outils d’optimisation, comme JpegOptim ou Optipng)\nFormats d’image : Cecil génère les formats AVIF et WebP de l’image\nImages adaptatives (responsive) : Cecil génère deux tailles d’image différentes (selon la configuration) pour servir la taille adaptée à chaque appareil\nChargement différé : l’image est configurée pour se charger de manière différée, c’est-à-dire uniquement lorsqu’elle apparaît dans la fenêtre d’affichage\nDécodage : le décodage de l’image est configuré pour être asynchrone, ce qui améliore le temps de chargement initial de la page\nEspace réservé : un espace réservé de couleur est affiché pendant le chargement de l’image\n\nConsultez la documentation pour plus de détails sur la configuration globale des assets et la configuration des pages.\nExemple\nVoici un exemple avec une image JPEG de 1920 × 1276 pixels.\n![Une région de formation d’étoiles dans le ciel](..\/..\/assets\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.jpg \"Photo d’Arnaud Girault\"){placeholder=color}\n\n\n\n\n\n\nPhoto d’Arnaud Girault\n\nConfiguration\n# configuration globale des assets\nassets:\n  images:\n    optimize: true\n    responsive:\n      widths: [768, 1024]\n# configuration des images dans du Markdown\npages:\n  body:\n    images:\n      formats: [avif, webp]\n      responsive: true\n      lazy: true\n      decoding: true\n      placeholder: color\nHTML généré\n&lt;picture title=\"Photo d’Arnaud Girault\"&gt;\n  &lt;source\n    type=\"image\/avif\"\n    srcset=\"\/thumbnails\/768x\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 768w,\n            \/thumbnails\/1024x\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 1024w\"\n    width=\"1024\"\n    height=\"681\"\n    sizes=\"100vw\"\n  &gt;\n  &lt;source\n    type=\"image\/webp\"\n    srcset=\"\/thumbnails\/768x\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 768w,\n            \/thumbnails\/1024x\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 1024w\"\n    width=\"1024\"\n    height=\"681\"\n    sizes=\"100vw\"\n  &gt;\n  &lt;img src=\"\/thumbnails\/1024x\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg\"\n    alt=\"Une région de formation d’étoiles dans le ciel\"\n    loading=\"lazy\"\n    decoding=\"async\"\n    width=\"1024\"\n    height=\"681\"\n    style=\";max-width:100%;height:auto;background-color:rgb(29 41 43);\"\n    srcset=\"\/thumbnails\/768x\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 768w,\n            \/thumbnails\/1024x\/images\/examples\/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 1024w\"\n    sizes=\"100vw\"\n  &gt;\n&lt;\/picture&gt;",
      "content_html": "<p>L’optimisation des images est l’un des moyens les plus efficaces d’améliorer les performances de votre site web.</p>\n<p>Cecil peut appliquer automatiquement les optimisations suivantes aux images Markdown (voir la configuration ci-dessous) :</p>\n<ol>\n<li><strong>Dimensions</strong> : les dimensions des images sont définies pour garantir une mise en page correcte et éviter les décalages</li>\n<li><strong>Compression</strong> : l’image est compressée pour réduire la taille du fichier sans perte significative de qualité (nécessite <code translate=\"no\">assets.images.optimize: true</code> et l’installation des outils d’optimisation, comme JpegOptim ou Optipng)</li>\n<li><strong>Formats d’image</strong> : Cecil génère les formats AVIF et WebP de l’image</li>\n<li><strong>Images adaptatives (<em>responsive</em>)</strong> : Cecil génère deux tailles d’image différentes (selon la configuration) pour servir la taille adaptée à chaque appareil</li>\n<li><strong>Chargement différé</strong> : l’image est configurée pour se charger de manière différée, c’est-à-dire uniquement lorsqu’elle apparaît dans la fenêtre d’affichage</li>\n<li><strong>Décodage</strong> : le décodage de l’image est configuré pour être asynchrone, ce qui améliore le temps de chargement initial de la page</li>\n<li><strong>Espace réservé</strong> : un espace réservé de couleur est affiché pendant le chargement de l’image</li>\n</ol>\n<aside class=\"note note-info\"><p>Consultez la documentation pour plus de détails sur la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/assets/#assets-images\">configuration globale des assets</a> et la <a href=\"https://cloudflare.cecil.app/fr/documentation/configuration/pages/#pages-body\">configuration des pages</a>.</p></aside>\n<h2 id=\"exemple\">Exemple<a class=\"heading-anchor\" href=\"#exemple\" aria-hidden=\"true\" tabindex=\"-1\"></a></h2>\n<p>Voici un exemple avec une image JPEG de 1920 × 1276 pixels.</p>\n<pre data-lang=\"markdown\"><code class=\"language-markdown hljs markdown\" translate=\"no\">![<span class=\"hljs-string\">Une région de formation d’étoiles dans le ciel</span>](<span class=\"hljs-link\">../../assets/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.jpg \"Photo d’Arnaud Girault\"</span>){placeholder=color}</code></pre>\n<figure>\n<picture title=\"Photo d’Arnaud Girault\">\n<source type=\"image/avif\" srcset=\"https://cloudflare.cecil.app/thumbnails/480x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 480w, https://cloudflare.cecil.app/thumbnails/768x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 768w, https://cloudflare.cecil.app/thumbnails/1024x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 1024w, https://cloudflare.cecil.app/thumbnails/1536x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 1536w\" width=\"1536\" height=\"1021\" sizes=\"100vw\">\n<source type=\"image/webp\" srcset=\"https://cloudflare.cecil.app/thumbnails/480x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 480w, https://cloudflare.cecil.app/thumbnails/768x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 768w, https://cloudflare.cecil.app/thumbnails/1024x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 1024w, https://cloudflare.cecil.app/thumbnails/1536x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 1536w\" width=\"1536\" height=\"1021\" sizes=\"100vw\">\n<img src=\"https://cloudflare.cecil.app/thumbnails/1536x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg\" alt=\"Une région de formation d’étoiles dans le ciel\" loading=\"lazy\" decoding=\"async\" class=\"dark:brightness-90\" width=\"1536\" height=\"1021\" style=\";max-width:100%;height:auto;background-color:rgb(32 42 42);\" srcset=\"https://cloudflare.cecil.app/thumbnails/480x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 480w, https://cloudflare.cecil.app/thumbnails/768x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 768w, https://cloudflare.cecil.app/thumbnails/1024x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 1024w, https://cloudflare.cecil.app/thumbnails/1536x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 1536w\" sizes=\"100vw\">\n</picture>\n<figcaption>Photo d’<a href=\"https://unsplash.com/fr/photos/une-region-de-formation-detoiles-dans-le-ciel-IjEtFjxXweE\" target=\"_blank\" rel=\"noopener noreferrer\">Arnaud Girault</a></figcaption>\n</figure>\n<h3 id=\"configuration\">Configuration<a class=\"heading-anchor\" href=\"#configuration\" aria-hidden=\"true\" tabindex=\"-1\"></a></h3>\n<pre data-lang=\"yaml\"><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-comment\"># configuration globale des assets</span>\n<span class=\"hljs-attr\">assets:</span>\n  <span class=\"hljs-attr\">images:</span>\n    <span class=\"hljs-attr\">optimize:</span> <span class=\"hljs-literal\">true</span>\n    <span class=\"hljs-attr\">responsive:</span>\n      <span class=\"hljs-attr\">widths:</span> <span class=\"hljs-string\">[768,</span> <span class=\"hljs-number\">1024</span><span class=\"hljs-string\">]</span>\n<span class=\"hljs-comment\"># configuration des images dans du Markdown</span>\n<span class=\"hljs-attr\">pages:</span>\n  <span class=\"hljs-attr\">body:</span>\n    <span class=\"hljs-attr\">images:</span>\n      <span class=\"hljs-attr\">formats:</span> <span class=\"hljs-string\">[avif,</span> <span class=\"hljs-string\">webp]</span>\n      <span class=\"hljs-attr\">responsive:</span> <span class=\"hljs-literal\">true</span>\n      <span class=\"hljs-attr\">lazy:</span> <span class=\"hljs-literal\">true</span>\n      <span class=\"hljs-attr\">decoding:</span> <span class=\"hljs-literal\">true</span>\n      <span class=\"hljs-attr\">placeholder:</span> <span class=\"hljs-string\">color</span></code></pre>\n<h3 id=\"html-genere\">HTML généré<a class=\"heading-anchor\" href=\"#html-genere\" aria-hidden=\"true\" tabindex=\"-1\"></a></h3>\n<pre data-lang=\"html\"><code class=\"language-html hljs xml\" translate=\"no\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">picture</span> <span class=\"hljs-attr\">title</span>=<span class=\"hljs-string\">\"Photo d’Arnaud Girault\"</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">source</span>\n    <span class=\"hljs-attr\">type</span>=<span class=\"hljs-string\">\"image/avif\"</span>\n    <span class=\"hljs-attr\">srcset</span>=<span class=\"hljs-string\">\"/thumbnails/768x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 768w,\n            /thumbnails/1024x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.avif 1024w\"</span>\n    <span class=\"hljs-attr\">width</span>=<span class=\"hljs-string\">\"1024\"</span>\n    <span class=\"hljs-attr\">height</span>=<span class=\"hljs-string\">\"681\"</span>\n    <span class=\"hljs-attr\">sizes</span>=<span class=\"hljs-string\">\"100vw\"</span>\n  &gt;</span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">source</span>\n    <span class=\"hljs-attr\">type</span>=<span class=\"hljs-string\">\"image/webp\"</span>\n    <span class=\"hljs-attr\">srcset</span>=<span class=\"hljs-string\">\"/thumbnails/768x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 768w,\n            /thumbnails/1024x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.webp 1024w\"</span>\n    <span class=\"hljs-attr\">width</span>=<span class=\"hljs-string\">\"1024\"</span>\n    <span class=\"hljs-attr\">height</span>=<span class=\"hljs-string\">\"681\"</span>\n    <span class=\"hljs-attr\">sizes</span>=<span class=\"hljs-string\">\"100vw\"</span>\n  &gt;</span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img</span> <span class=\"hljs-attr\">src</span>=<span class=\"hljs-string\">\"/thumbnails/1024x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg\"</span>\n    <span class=\"hljs-attr\">alt</span>=<span class=\"hljs-string\">\"Une région de formation d’étoiles dans le ciel\"</span>\n    <span class=\"hljs-attr\">loading</span>=<span class=\"hljs-string\">\"lazy\"</span>\n    <span class=\"hljs-attr\">decoding</span>=<span class=\"hljs-string\">\"async\"</span>\n    <span class=\"hljs-attr\">width</span>=<span class=\"hljs-string\">\"1024\"</span>\n    <span class=\"hljs-attr\">height</span>=<span class=\"hljs-string\">\"681\"</span>\n    <span class=\"hljs-attr\">style</span>=<span class=\"hljs-string\">\";max-width:100%;height:auto;background-color:rgb(29 41 43);\"</span>\n    <span class=\"hljs-attr\">srcset</span>=<span class=\"hljs-string\">\"/thumbnails/768x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 768w,\n            /thumbnails/1024x/images/examples/arnaud-girault-IjEtFjxXweE-unsplash.9f9b5448197aded5325854d4f3c79652.jpg 1024w\"</span>\n    <span class=\"hljs-attr\">sizes</span>=<span class=\"hljs-string\">\"100vw\"</span>\n  &gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">picture</span>&gt;</span></code></pre>",
      "language": "fr"
    }
  ]
}
