{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Cecil - Templates",
  "home_page_url": "https://cecil.app/fr/documentation/templates/",
  "feed_url": "https://cecil.app/fr/documentation/templates/feed.json",
  "description": "Travaillez avec les layouts, templates et composants Twig.",
  "icon": "https://cecil.app/favicon.7ff4b89eec6dad139a7d2d6561543285.png",
  "favicon": "https://cecil.app/thumbnails/64x/favicon.7ff4b89eec6dad139a7d2d6561543285.png",
  "language": "fr",
  "items": [
    {
      "id": "https://cecil.app/fr/documentation/templates/regles-de-recherche/",
      "url": "https://cecil.app/fr/documentation/templates/regles-de-recherche/",
      "title": "Organisation et règles de recherche",
      "summary": "Types de templates, convention de nommage, templates intégrés et choix du template d’une page.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Organisation et règles de recherche\nOrganisation des fichiers\nTypes de templates\nIl existe trois types de templates, layouts, components et autres templates : layouts sont utilisés pour afficher les pages, et chacun d'eux peut inclure des templates et components.\nConvention de nommage\nLes fichiers templates sont stockés dans le répertoire layouts\/ et doivent être nommés selon la convention suivante :\nlayouts\/(&lt;section&gt;\/)&lt;type&gt;|&lt;layout&gt;.&lt;format&gt;(.&lt;language&gt;).twig\n\n&lt;section&gt; (facultatif)\nLa section de la page (ex. : blog).\n&lt;type&gt;\nLe type de page : home (ou index) pour homepage, list pour list, page pour page, etc. (Voir Règles de recherche pour plus de détails).\n&lt;layout&gt; (facultatif)\nLe nom de la layout personnalisée défini dans le front-matter de la page (par exemple : layout: my-layout).\n&lt;format&gt;\nLe format de sortie de la page rendue (par exemple : html, rss, json, xml, etc.).\n&lt;language&gt; (facultatif)\nLa langue de la page (ex. : fr).\n\nExemples :\nlayouts\/home.html.twig       # `type` est \"homepage\"\nlayouts\/page.html.twig       # `type` est \"page\"\nlayouts\/page.html.fr.twig    # `type` est \"page\" et `language` est \"fr\"\nlayouts\/my-layout.html.twig  # `layout` est \"my-layout\"\nlayouts\/blog\/list.html.twig  # `section` est \"blog\"\nlayouts\/blog\/list.rss.twig   # `section` est \"blog\" et `format` est \"rss\"\n&lt;mon-site&gt;\n├─ ...\n├─ layouts\n|  ├─ index.html.twig      # Utilisé par le type \"homepage\"\n|  ├─ list.html.twig       # Utilisé par les types \"homepage\" et \"section\"\n|  ├─ list.rss.twig        # Utilisé par les types \"homepage\" et \"section\", pour le format de sortie RSS\n|  ├─ page.html.twig       # Utilisé par le type \"page\"\n|  ├─ taxonomy\n|  |  ├─ tags.html.twig    # Utilisé par le type \"vocabulary\" de `tags` (liste des termes)\n|  |  └─ tag.html.twig     # Utilisé par le type \"term\" de `tags` (liste des pages)\n|  ├─ my-layout.html.twig  # Utilisé par les pages avec `layout: my-layout` dans le front-matter\n|  ├─ ...\n|  └─ partials\n|     ├─ footer.html.twig  # Template inclus\n|     └─ ...\n└─ themes                  # Layouts et templates des thèmes\n   └─ ...\nTemplates intégrés\nCecil est livré avec un ensemble de templates intégrés.\nSi vous avez besoin de modifier des templates intégrés, vous pouvez facilement les extraire via la commande suivante : ils seront copiés dans le répertoire layouts de votre site.\nphp cecil.phar util:templates:extract\nRègles de recherche\nDans la plupart des cas vous n'avez pas besoin de préciser la layout : Cecil sélectionne la layout la plus appropriée, en fonction du type de la page.\nPar exemple, la sortie HTML de home page (index.md) sera rendue :\n\navec my-layout.html.twig si la variable layout est définie sur \"my-layout\" (dans le préambule)\nsinon, avec index.html.twig si le fichier existe\nsinon, avec home.html.twig si le fichier existe\nsinon, avec list.html.twig si le fichier existe\n\nToutes les règles sont détaillées ci-dessous, pour chaque type de page, par ordre de priorité.\nType homepage\n\n&lt;layout&gt;.&lt;format&gt;.twig\nindex.&lt;format&gt;.twig\nhome.&lt;format&gt;.twig\nlist.&lt;format&gt;.twig\n_default\/&lt;layout&gt;.&lt;format&gt;.twig\n_default\/index.&lt;format&gt;.twig\n_default\/home.&lt;format&gt;.twig\n_default\/list.&lt;format&gt;.twig\n_default\/page.&lt;format&gt;.twig\n\nType page\n\n&lt;section&gt;\/&lt;layout&gt;.&lt;format&gt;.twig\n&lt;layout&gt;.&lt;format&gt;.twig\n&lt;section&gt;\/page.&lt;format&gt;.twig\n_default\/&lt;layout&gt;.&lt;format&gt;.twig\npage.&lt;format&gt;.twig\n_default\/page.&lt;format&gt;.twig\n\nType section\n\n&lt;layout&gt;.&lt;format&gt;.twig\n&lt;section&gt;\/index.&lt;format&gt;.twig\n&lt;section&gt;\/list.&lt;format&gt;.twig\nsection\/&lt;section&gt;.&lt;format&gt;.twig\n&lt;parent&gt;\/index.&lt;format&gt;.twig, &lt;parent&gt;\/list.&lt;format&gt;.twig et section\/&lt;parent&gt;.&lt;format&gt;.twig, pour chaque section parente d’une sous-section (la plus proche en premier)\n_default\/section.&lt;format&gt;.twig\nlist.&lt;format&gt;.twig\n_default\/list.&lt;format&gt;.twig\n\nLa &lt;section&gt; d’une sous-section est son chemin complet (ex. : blog\/2024), et une sous-section se replie sur les templates de ses sections parentes : si blog\/2024\/list.html.twig n’existe pas, la sous-section blog\/2024 est rendue avec blog\/list.html.twig.\nType vocabulary\n\ntaxonomy\/&lt;plural&gt;.&lt;format&gt;.twig\nvocabulary.&lt;format&gt;.twig\n_default\/vocabulary.&lt;format&gt;.twig\n\nType term\n\ntaxonomy\/&lt;plural&gt;\/&lt;term&gt;.&lt;format&gt;.twig\ntaxonomy\/&lt;singular&gt;.&lt;format&gt;.twig\nterm.&lt;format&gt;.twig\n_default\/term.&lt;format&gt;.twig\n_default\/list.&lt;format&gt;.twig\n\nLe template du vocabulaire est nommé d’après le pluriel (ex. : taxonomy\/categories.html.twig pour \/categories\/), tandis que le template d’un terme est nommé d’après le singulier (ex. : taxonomy\/category.html.twig pour \/categories\/data-sovereignty\/).\n&lt;term&gt; est le nom du terme « slugifié » : un template dédié au terme « Data Sovereignty » du vocabulaire categories est taxonomy\/categories\/data-sovereignty.html.twig.\nLa plupart de ces layouts sont disponibles par défaut, voir templates intégrés.",
      "content_html": "<h1>Organisation et règles de recherche</h1>\n<h2 id=\"organisation-des-fichiers\">Organisation des fichiers</h2>\n<h3 id=\"types-de-templates\">Types de templates</h3>\n<p>Il existe trois types de templates, <strong><em>layouts</em></strong>, <strong><em>components</em></strong> et <strong><em>autres templates</em></strong> : <em>layouts</em> sont utilisés pour afficher les <a href=\"../content/1-pages.fr.md\">pages</a>, et chacun d'eux peut <a href=\"https://twig.symfony.com/doc/templates.html#including-other-templates\" target=\"_blank\" rel=\"noopener noreferrer\">inclure des templates</a> et <a href=\"4-components.fr.md\">components</a>.</p>\n<h3 id=\"convention-de-nommage\">Convention de nommage</h3>\n<p>Les fichiers templates sont stockés dans le répertoire <code translate=\"no\">layouts/</code> et doivent être nommés selon la convention suivante :</p>\n<pre><code class=\"language-plaintext hljs plaintext\" translate=\"no\">layouts/(&lt;section&gt;/)&lt;type&gt;|&lt;layout&gt;.&lt;format&gt;(.&lt;language&gt;).twig</code></pre>\n<dl>\n<dt><code translate=\"no\">&lt;section&gt;</code> (<em>facultatif</em>)</dt>\n<dd>La section de la page (ex. : <code translate=\"no\">blog</code>).</dd>\n<dt><code translate=\"no\">&lt;type&gt;</code></dt>\n<dd>Le type de page : <code translate=\"no\">home</code> (ou <code translate=\"no\">index</code>) pour <em>homepage</em>, <code translate=\"no\">list</code> pour <em>list</em>, <code translate=\"no\">page</code> pour <em>page</em>, etc. (Voir <a href=\"#regles-de-recherche\"><em>Règles de recherche</em></a> pour plus de détails).</dd>\n<dt><code translate=\"no\">&lt;layout&gt;</code> (<em>facultatif</em>)</dt>\n<dd>Le nom de la layout personnalisée défini dans le <a href=\"../content/1-pages.fr.md#front-matter\">front-matter</a> de la page (par exemple : <code translate=\"no\">layout: my-layout</code>).</dd>\n<dt><code translate=\"no\">&lt;format&gt;</code></dt>\n<dd>Le <a href=\"../configuration/8-output.fr.md#output-formats\">format de sortie</a> de la page rendue (par exemple : <code translate=\"no\">html</code>, <code translate=\"no\">rss</code>, <code translate=\"no\">json</code>, <code translate=\"no\">xml</code>, etc.).</dd>\n<dt><code translate=\"no\">&lt;language&gt;</code> (<em>facultatif</em>)</dt>\n<dd>La langue de la page (ex. : <code translate=\"no\">fr</code>).</dd>\n</dl>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-plaintext hljs plaintext\" translate=\"no\">layouts/home.html.twig       # `type` est \"homepage\"\nlayouts/page.html.twig       # `type` est \"page\"\nlayouts/page.html.fr.twig    # `type` est \"page\" et `language` est \"fr\"\nlayouts/my-layout.html.twig  # `layout` est \"my-layout\"\nlayouts/blog/list.html.twig  # `section` est \"blog\"\nlayouts/blog/list.rss.twig   # `section` est \"blog\" et `format` est \"rss\"</code></pre>\n<pre><code class=\"language-plaintext hljs plaintext\" translate=\"no\">&lt;mon-site&gt;\n├─ ...\n├─ layouts\n|  ├─ index.html.twig      # Utilisé par le type \"homepage\"\n|  ├─ list.html.twig       # Utilisé par les types \"homepage\" et \"section\"\n|  ├─ list.rss.twig        # Utilisé par les types \"homepage\" et \"section\", pour le format de sortie RSS\n|  ├─ page.html.twig       # Utilisé par le type \"page\"\n|  ├─ taxonomy\n|  |  ├─ tags.html.twig    # Utilisé par le type \"vocabulary\" de `tags` (liste des termes)\n|  |  └─ tag.html.twig     # Utilisé par le type \"term\" de `tags` (liste des pages)\n|  ├─ my-layout.html.twig  # Utilisé par les pages avec `layout: my-layout` dans le front-matter\n|  ├─ ...\n|  └─ partials\n|     ├─ footer.html.twig  # Template inclus\n|     └─ ...\n└─ themes                  # Layouts et templates des thèmes\n   └─ ...</code></pre>\n<h3 id=\"templates-integres\">Templates intégrés</h3>\n<p>Cecil est livré avec un ensemble de <a href=\"https://github.com/Cecilapp/Cecil/tree/main/resources/layouts\" target=\"_blank\" rel=\"noopener noreferrer\">templates intégrés</a>.</p>\n<aside class=\"note note-tip\"><p>Si vous avez besoin de modifier des templates intégrés, vous pouvez facilement les extraire via la commande suivante : ils seront copiés dans le répertoire <code translate=\"no\">layouts</code> de votre site.</p>\n<pre><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar util:templates:extract</code></pre></aside>\n<h2 id=\"regles-de-recherche\">Règles de recherche</h2>\n<p>Dans la plupart des cas <strong>vous n'avez pas besoin de préciser la layout</strong> : Cecil sélectionne la layout la plus appropriée, en fonction du <strong>type de la page</strong>.</p>\n<p>Par exemple, la sortie HTML de <strong>home page</strong> (<code translate=\"no\">index.md</code>) sera rendue :</p>\n<ol>\n<li>avec <code translate=\"no\">my-layout.html.twig</code> si la variable <code translate=\"no\">layout</code> est définie sur \"my-layout\" (dans le préambule)</li>\n<li>sinon, avec <code translate=\"no\">index.html.twig</code> si le fichier existe</li>\n<li>sinon, avec <code translate=\"no\">home.html.twig</code> si le fichier existe</li>\n<li>sinon, avec <code translate=\"no\">list.html.twig</code> si le fichier existe</li>\n</ol>\n<p>Toutes les règles sont détaillées ci-dessous, pour chaque type de page, par ordre de priorité.</p>\n<h3 id=\"type-homepage\">Type <em>homepage</em></h3>\n<ol>\n<li><code translate=\"no\">&lt;layout&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">index.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">home.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">list.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/&lt;layout&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/index.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/home.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/list.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/page.&lt;format&gt;.twig</code></li>\n</ol>\n<h3 id=\"type-page\">Type <em>page</em></h3>\n<ol>\n<li><code translate=\"no\">&lt;section&gt;/&lt;layout&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">&lt;layout&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">&lt;section&gt;/page.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/&lt;layout&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">page.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/page.&lt;format&gt;.twig</code></li>\n</ol>\n<h3 id=\"type-section\">Type <em>section</em></h3>\n<ol>\n<li><code translate=\"no\">&lt;layout&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">&lt;section&gt;/index.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">&lt;section&gt;/list.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">section/&lt;section&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">&lt;parent&gt;/index.&lt;format&gt;.twig</code>, <code translate=\"no\">&lt;parent&gt;/list.&lt;format&gt;.twig</code> et <code translate=\"no\">section/&lt;parent&gt;.&lt;format&gt;.twig</code>, pour chaque section parente d’une sous-section (la plus proche en premier)</li>\n<li><code translate=\"no\">_default/section.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">list.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/list.&lt;format&gt;.twig</code></li>\n</ol>\n<aside class=\"note note-tip\"><p>La <code translate=\"no\">&lt;section&gt;</code> d’une <a href=\"../content/1-pages.fr.md#sous-section\">sous-section</a> est son chemin complet (ex. : <code translate=\"no\">blog/2024</code>), et une sous-section se replie sur les templates de ses sections parentes : si <code translate=\"no\">blog/2024/list.html.twig</code> n’existe pas, la sous-section <code translate=\"no\">blog/2024</code> est rendue avec <code translate=\"no\">blog/list.html.twig</code>.</p></aside>\n<h3 id=\"type-vocabulary\">Type <em>vocabulary</em></h3>\n<ol>\n<li><code translate=\"no\">taxonomy/&lt;plural&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">vocabulary.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/vocabulary.&lt;format&gt;.twig</code></li>\n</ol>\n<h3 id=\"type-term\">Type <em>term</em></h3>\n<ol>\n<li><code translate=\"no\">taxonomy/&lt;plural&gt;/&lt;term&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">taxonomy/&lt;singular&gt;.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">term.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/term.&lt;format&gt;.twig</code></li>\n<li><code translate=\"no\">_default/list.&lt;format&gt;.twig</code></li>\n</ol>\n<aside class=\"note note-important\"><p>Le template du <strong>vocabulaire</strong> est nommé d’après le <strong>pluriel</strong> (ex. : <code translate=\"no\">taxonomy/categories.html.twig</code> pour <code translate=\"no\">/categories/</code>), tandis que le template d’un <strong>terme</strong> est nommé d’après le <strong>singulier</strong> (ex. : <code translate=\"no\">taxonomy/category.html.twig</code> pour <code translate=\"no\">/categories/data-sovereignty/</code>).</p></aside>\n<aside class=\"note note-tip\"><p><code translate=\"no\">&lt;term&gt;</code> est le nom du terme « slugifié » : un template dédié au terme « Data Sovereignty » du vocabulaire <code translate=\"no\">categories</code> est <code translate=\"no\">taxonomy/categories/data-sovereignty.html.twig</code>.</p></aside>\n<aside class=\"note note-info\"><p>La plupart de ces layouts sont disponibles par défaut, voir <a href=\"#templates-integres\">templates intégrés</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/reference/fonctions/",
      "url": "https://cecil.app/fr/documentation/templates/reference/fonctions/",
      "title": "Fonctions",
      "summary": "url, html, readtime, hash, cache_key, getenv, dump, etc.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Fonctions\n\nFonctions peut être appelée pour générer du contenu. Les fonctions sont appelées par leur nom suivi de parenthèses (()) et peuvent avoir des arguments.\n\nurl\nCrée une URL valide pour une page, une entrée de menu, un actif, un ID de page ou un chemin.\n{{ url(value, {options}) }}\n\n\n\nOptions\nDescriptif\nTapez\nPar défaut\n\n\n\n\ncanonique\nPréfixez l'URL avec baseurl ou utilisez canonical.url s'il existe.\nbooléen\nfalse\n\n\nformats\nDéfinit la page format de sortie (par exemple : json).\nchaîne\nhtml\n\n\nlangue\nDéfinit la page langue (ex. : fr).\nchaîne\nnul\n\n\n\nExemples :\n{# page #}\n{{ url(page) }}\n{{ url(page, {canonical: true}) }}\n{{ url(page, {format: json}) }}\n{{ url(page, {language: fr}) }}\n{# menu entry #}\n{{ url(site.menus.main.about) }}\n{# asset #}\n{{ url(asset('styles.css')) }}\n{# page ID #}\n{{ url('page-id') }}\n{# path #}\n{{ url('about-me\/') }}\n{{ url('tags\/' ~ tag) }}\nPour plus de commodité, la fonction url est également disponible sous forme de filtre :\n{# page #}\n{{ page|url }}\n{{ page|url({canonical: true, format: json, language: fr}) }}\n{# asset #}\n{{ asset('styles.css')|url }}\nLorsque la valeur est une chaîne, url() la « slugifie » pour trouver un ID de page correspondant (ex. : url('tags\/My Tag') retourne l’URL de la page tags\/my-tag). Si aucune page ne correspond, la chaîne est conservée comme chemin, avec les caractères invalides (ex. : espaces) encodés.\nhtml\nCrée un élément HTML à partir d'un actif (ou d'un tableau d'actifs avec des attributs personnalisés).\n{{ html(asset, {attributes}, {options}) }}\n{# dedicated functions for each common type of asset #}\n{{ css(asset) }}\n{{ js(asset) }}\n{{ image(asset) }}\n{{ audio(asset) }}\n{{ video(asset) }}\n\n\n\nOptions\nDescriptif\nTapez\n\n\n\n\nattributs\nAjoute le couple name=\"value\" à l'élément HTML.\ntableau\n\n\noptions\n{preload: boolean} : préchargements.Pour les images :{formats: array} : ajoute des formats alternatifs.{responsive: bool|string} : ajoute des images réactives (basées sur width ou des pixels density).{placeholder: string} : remplit l'arrière-plan de l'image avant son chargement (color ou lqip).\ntableau\n\n\n\nDepuis la version 8.42.0, la fonction html remplace le filtre html obsolète.\nVous pouvez définir un comportement global par défaut des options d'images (formats, responsive et placeholder) via la configuration des layouts.\nLorsque layouts.images.dark_suffix est configuré (par exemple .dark), Cecil recherche automatiquement une variante sombre de chaque image (par exemple photo.dark.jpg aux côtés de photo.jpg) et génère un élément &lt;picture&gt; avec un &lt;source media=\"(prefers-color-scheme: dark)\"&gt;.\nDe la même manière, lorsque layouts.images.mobile_suffix est configuré (par exemple .mobile), Cecil recherche une variante mobile de chaque image (par exemple photo.mobile.jpg) et ajoute un &lt;source&gt; avec la media query layouts.images.mobile_media_query. Si une variante sombre de l’image mobile existe (par exemple photo.mobile.dark.jpg), elle est utilisée sur mobile en mode sombre.\nExemples :\n{# CSS with an attribute #}\n{{ html(asset('print.css'), {media: 'print'}) }}\n{# CSS with an attribute and an option #}\n{{ html(asset('styles.css'), {title: 'Main theme'}, {preload: true}) }}\n{# Array of assets with media query #}\n{{ html([\n  {asset: asset('css\/style.css')},\n  {asset: asset('css\/style-dark.css'), attributes: {media: '(prefers-color-scheme: dark)'}}\n]) }}\n{# JavaScript #}\n{{ html(asset('script.js')) }}\n{# image without specific attributes nor options #}\n{{ html(asset('image.png')) }}\n{# image with specific attributes, responsive images and alternative formats #}\n{{ html(asset('image.jpg'), {alt: 'Description', loading: 'lazy'}, {responsive: true, formats: ['avif', 'webp']}) }}\n{# image with responsive pixels density images #}\n{{ html(asset('image.jpg'), options={responsive: 'density'}, attributes={width: 256}) }}\n{# image with a Low-Quality Image Placeholder #}\n{{ html(asset('image.jpg'), {alt: 'Description', loading: 'lazy'}, {placeholder: 'lqip'}) }}\n{# Audio #}\n{{ html(asset('audio.mp3')) }}\n{# Video #}\n{{ html(asset('video.mp4')) }}\nPour plus de commodité, la fonction html reste disponible en tant que filtre (mais est considérée comme obsolète) :\n{{ asset|html({attributes}, {options}) }}\nreadtime\nDétermine le temps de lecture d'un texte, en minutes.\n{{ readtime(value) }}\nExemple:\n{{ readtime(page.content) }} min\nhash\nCalcule le hachage d'un objet, d'un tableau ou d'une chaîne avec un algorithme donné.\n{{ hash(value, algorithm) }}\nalgorithm peut être n'importe quel algorithme pris en charge par la fonction hash() de PHP (par exemple : md5, sha256, etc.). La valeur par défaut est xxh128.\nExemple:\n{{ hash('my string', 'sha256') }}\ncache_key\nCalcule une clé de cache pour fragments cache en fonction d'un nom et d'une valeur facultative.\n{% cache cache_key(name, value) %}\n  {# cacheable content #}\n{% endcache %}\nLa fonction ajoute un hachage de la valeur (peut être une chaîne, un tableau ou un objet) au nom (ainsi que la langue actuelle et l'ID de build pour être sûr que la clé de cache générée est unique), donc si la valeur est modifiée, la clé de cache est également modifiée et le cache est automatiquement vidé.\ngetenv\nObtient la valeur d'une variable d'environnement à partir de sa clé.\n{{ getenv(var) }}\nExemple:\n{{ getenv('VAR') }}\ndump\nLa fonction dump affiche les informations sur une variable de modèle. Ceci est surtout utile pour déboguer un modèle qui ne se comporte pas comme prévu en introspectant ses variables :\n{{ dump(user) }}\nLe debug mode doit être activé.\nd\nLa fonction d() est la version HTML de dump() et utilise le Symfony VarDumper Component en arrière-plan.\n{{ d(variable, {theme: light}) }}\n\nSi variable n'est pas fourni, la fonction renvoie le contexte Twig actuel\nLes thèmes disponibles sont « clair » (par défaut) et « sombre »\n\nLe debug mode doit être activé.",
      "content_html": "<h1>Fonctions</h1>\n<blockquote>\n<p><a href=\"https://twig.symfony.com/doc/functions/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">Fonctions</a> peut être appelée pour générer du contenu. Les fonctions sont appelées par leur nom suivi de parenthèses (<code translate=\"no\">()</code>) et peuvent avoir des arguments.</p>\n</blockquote>\n<h2 id=\"url\">url</h2>\n<p>Crée une URL valide pour une page, une entrée de menu, un actif, un ID de page ou un chemin.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ url(value, {options}) }}</span></code></pre>\n<table>\n<thead>\n<tr>\n<th>Options</th>\n<th>Descriptif</th>\n<th>Tapez</th>\n<th>Par défaut</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>canonique</td>\n<td>Préfixez l'URL avec <a href=\"../../configuration/1-site.fr.md#baseurl\"><code translate=\"no\">baseurl</code></a> ou utilisez <a href=\"../../configuration/1-site.fr.md#options-metatags\"><code translate=\"no\">canonical.url</code></a> s'il existe.</td>\n<td>booléen</td>\n<td><code translate=\"no\">false</code></td>\n</tr>\n<tr>\n<td>formats</td>\n<td>Définit la page <a href=\"../../configuration/8-output.fr.md#output-formats\">format de sortie</a> (par exemple : <code translate=\"no\">json</code>).</td>\n<td>chaîne</td>\n<td><code translate=\"no\">html</code></td>\n</tr>\n<tr>\n<td>langue</td>\n<td>Définit la page <a href=\"../../configuration/2-languages.fr.md#language\">langue</a> (ex. : <code translate=\"no\">fr</code>).</td>\n<td>chaîne</td>\n<td>nul</td>\n</tr>\n</tbody>\n</table>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# page #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url(page) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url(page, {canonical: true}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url(page, {format: json}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url(page, {language: fr}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# menu entry #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url(site.menus.main.about) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# asset #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url(asset('styles.css')) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# page ID #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url('page-id') }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# path #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url('about-me/') }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ url('tags/' ~ tag) }}</span></code></pre>\n<aside class=\"note note-info\"><p>Pour plus de commodité, la fonction <code translate=\"no\">url</code> est également disponible sous forme de filtre :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# page #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ page|url }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ page|url({canonical: true, format: json, language: fr}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# asset #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ asset('styles.css')|url }}</span></code></pre></aside>\n<aside class=\"note note-tip\"><p>Lorsque la valeur est une chaîne, <code translate=\"no\">url()</code> la « slugifie » pour trouver un ID de page correspondant (ex. : <code translate=\"no\">url('tags/My Tag')</code> retourne l’URL de la page <code translate=\"no\">tags/my-tag</code>). Si aucune page ne correspond, la chaîne est conservée comme chemin, avec les caractères invalides (ex. : espaces) encodés.</p></aside>\n<h2 id=\"html\">html</h2>\n<p>Crée un élément HTML à partir d'un actif (ou d'un tableau d'actifs avec des attributs personnalisés).</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ html(asset, {attributes}, {options}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# dedicated functions for each common type of asset #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ css(asset) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ js(asset) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ image(asset) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ audio(asset) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ video(asset) }}</span></code></pre>\n<table>\n<thead>\n<tr>\n<th>Options</th>\n<th>Descriptif</th>\n<th>Tapez</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>attributs</td>\n<td>Ajoute le couple <code translate=\"no\">name=\"value\"</code> à l'élément HTML.</td>\n<td>tableau</td>\n</tr>\n<tr>\n<td>options</td>\n<td><code translate=\"no\">{preload: boolean}</code> : préchargements.<br>Pour les images :<br><code translate=\"no\">{formats: array}</code> : ajoute des formats alternatifs.<br><code translate=\"no\">{responsive: bool|string}</code> : ajoute des images réactives (basées sur <code translate=\"no\">width</code> ou des pixels <code translate=\"no\">density</code>).<br><code translate=\"no\">{placeholder: string}</code> : remplit l'arrière-plan de l'image avant son chargement (<code translate=\"no\">color</code> ou <code translate=\"no\">lqip</code>).</td>\n<td>tableau</td>\n</tr>\n</tbody>\n</table>\n<aside class=\"note note-warning\"><p>Depuis la version <ins>8.42.0</ins>, la fonction <code translate=\"no\">html</code> remplace le filtre <code translate=\"no\">html</code> obsolète.</p></aside>\n<aside class=\"note note-tip\"><p>Vous pouvez définir un comportement global par défaut des options d'images (<code translate=\"no\">formats</code>, <code translate=\"no\">responsive</code> et <code translate=\"no\">placeholder</code>) via la <a href=\"../../configuration/7-layouts.fr.md#layouts-images\">configuration des layouts</a>.</p>\n<p>Lorsque <a href=\"../../configuration/7-layouts.fr.md#layouts-images\"><code translate=\"no\">layouts.images.dark_suffix</code></a> est configuré (par exemple <code translate=\"no\">.dark</code>), Cecil recherche automatiquement une variante sombre de chaque image (par exemple <code translate=\"no\">photo.dark.jpg</code> aux côtés de <code translate=\"no\">photo.jpg</code>) et génère un élément <code translate=\"no\">&lt;picture&gt;</code> avec un <code translate=\"no\">&lt;source media=\"(prefers-color-scheme: dark)\"&gt;</code>.</p>\n<p>De la même manière, lorsque <a href=\"../../configuration/7-layouts.fr.md#layouts-images\"><code translate=\"no\">layouts.images.mobile_suffix</code></a> est configuré (par exemple <code translate=\"no\">.mobile</code>), Cecil recherche une variante mobile de chaque image (par exemple <code translate=\"no\">photo.mobile.jpg</code>) et ajoute un <code translate=\"no\">&lt;source&gt;</code> avec la media query <a href=\"../../configuration/7-layouts.fr.md#layouts-images\"><code translate=\"no\">layouts.images.mobile_media_query</code></a>. Si une variante sombre de l’image mobile existe (par exemple <code translate=\"no\">photo.mobile.dark.jpg</code>), elle est utilisée sur mobile en mode sombre.</p></aside>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# CSS with an attribute #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('print.css'), {media: 'print'}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# CSS with an attribute and an option #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('styles.css'), {title: 'Main theme'}, {preload: true}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# Array of assets with media query #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html([\n  {asset: asset('css/style.css')},\n  {asset: asset('css/style-dark.css'), attributes: {media: '(prefers-color-scheme: dark)'}}</span><span class=\"xml\">\n]) }}\n</span><span class=\"hljs-comment\">{# JavaScript #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('script.js')) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# image without specific attributes nor options #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('image.png')) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# image with specific attributes, responsive images and alternative formats #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('image.jpg'), {alt: 'Description', loading: 'lazy'}, {responsive: true, formats: ['avif', 'webp']}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# image with responsive pixels density images #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('image.jpg'), options={responsive: 'density'}, attributes={width: 256}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# image with a Low-Quality Image Placeholder #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('image.jpg'), {alt: 'Description', loading: 'lazy'}, {placeholder: 'lqip'}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# Audio #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('audio.mp3')) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# Video #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ html(asset('video.mp4')) }}</span></code></pre>\n<aside class=\"note note-info\"><p>Pour plus de commodité, la fonction <code translate=\"no\">html</code> reste disponible en tant que filtre (mais est considérée comme obsolète) :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ asset|html({attributes}, {options}) }}</span></code></pre></aside>\n<h2 id=\"readtime\">readtime</h2>\n<p>Détermine le temps de lecture d'un texte, en minutes.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ readtime(value) }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ readtime(page.content) }}</span><span class=\"xml\"> min</span></code></pre>\n<h2 id=\"hash\">hash</h2>\n<p>Calcule le hachage d'un objet, d'un tableau ou d'une chaîne avec un algorithme donné.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ hash(value, algorithm) }}</span></code></pre>\n<p><code translate=\"no\">algorithm</code> peut être n'importe quel algorithme pris en charge par la fonction <code translate=\"no\">hash()</code> de PHP (par exemple : <code translate=\"no\">md5</code>, <code translate=\"no\">sha256</code>, etc.). La valeur par défaut est <code translate=\"no\">xxh128</code>.</p>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ hash('my string', 'sha256') }}</span></code></pre>\n<h2 id=\"cache-key\">cache_key</h2>\n<p>Calcule une clé de cache pour <a href=\"../6-cache.fr.md#fragments-de-cache\"><em>fragments</em> cache</a> en fonction d'un nom et d'une valeur facultative.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">cache</span> cache_key(name, value) %}</span><span class=\"xml\">\n  </span><span class=\"hljs-comment\">{# cacheable content #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endcache</span> %}</span></code></pre>\n<p>La fonction ajoute un hachage de la valeur (peut être une chaîne, un tableau ou un objet) au nom (ainsi que la langue actuelle et l'ID de build pour être sûr que la clé de cache générée est unique), donc si la valeur est modifiée, la clé de cache est également modifiée et le cache est automatiquement vidé.</p>\n<h2 id=\"getenv\">getenv</h2>\n<p>Obtient la valeur d'une variable d'environnement à partir de sa clé.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ getenv(var) }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ getenv('VAR') }}</span></code></pre>\n<h2 id=\"dump\">dump</h2>\n<p>La fonction <code translate=\"no\">dump</code> affiche les informations sur une variable de modèle. Ceci est surtout utile pour déboguer un modèle qui ne se comporte pas comme prévu en introspectant ses variables :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ <span class=\"hljs-name\">dump</span><span class=\"hljs-params\">(user)</span> }}</span></code></pre>\n<aside class=\"note note-important\"><p>Le <a href=\"../../configuration/1-site.fr.md#debug\"><em>debug mode</em></a> doit être activé.</p></aside>\n<h2 id=\"d\">d</h2>\n<p>La fonction <code translate=\"no\">d()</code> est la version HTML de <a href=\"#dump\"><code translate=\"no\">dump()</code></a> et utilise le <a href=\"https://symfony.com/doc/5.4/components/var_dumper.html\" target=\"_blank\" rel=\"noopener noreferrer\">Symfony VarDumper Component</a> en arrière-plan.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ d(variable, {theme: light}) }}</span></code></pre>\n<ul>\n<li>Si <em>variable</em> n'est pas fourni, la fonction renvoie le contexte Twig actuel</li>\n<li>Les thèmes disponibles sont « clair » (par défaut) et « sombre »</li>\n</ul>\n<aside class=\"note note-important\"><p>Le <a href=\"../../configuration/1-site.fr.md#debug\"><em>debug mode</em></a> doit être activé.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/variables/",
      "url": "https://cecil.app/fr/documentation/templates/variables/",
      "title": "Variables",
      "summary": "Variables disponibles dans les templates : site, page et cecil.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-06T00:00:00+00:00","content_text": "Variables\n\nL'application transmet des variables aux templates pour manipulation dans le modèle. Les variables peuvent également avoir des attributs ou des éléments auxquels vous pouvez accéder.\nUtilisez un point (.) pour accéder aux attributs d'une variable : {{ foo.bar }}\n\nVous pouvez utiliser des variables de différentes portées : site, page, cecil.\nsite\nLa variable site contient des variables intégrées et celles définies dans la configuration.\n\n\n\nVariables\nDescriptif\n\n\n\n\nsite.pages\nCollection de toutes les pages, dans la langue actuelle.\n\n\nsite.allpages\nCollection de toutes les pages, dans toutes les langues.\n\n\nsite.page(id)\nUne page avec l'ID donné.\n\n\nsite.taxonomies\nRecueil de vocabulaires.\n\n\nsite.home\nID de la page d'accueil.\n\n\nsite.time\nActuel Timestamp.\n\n\nsite.debug\nÉtat du mode débogage (true ou false).\n\n\nsite.build\nID de build actuel.\n\n\n\nExemple:\ntitle: \"My amazing website!\"\nPeut être affiché dans un modèle avec :\n{{ site.title }}\nUtilisez la méthode showable sur la collection de pages pour renvoyer uniquement les pages publiées et non les pages virtuelles\/redirectes\/exclues.\nExemple:\n{% for page in site.pages.showable %}\n  &lt;a href=\"{{ url(page) }}\"&gt;{{ page.title }}&lt;\/a&gt;\n{% endfor %}\nDans certains cas, vous pouvez rencontrer des conflits entre la configuration et les variables intégrées (ex. : pages.default configuration), vous pouvez donc utiliser config.&lt;variable&gt; (avec &lt;variable&gt; est le nom\/chemin de la variable) pour accéder directement à la configuration brute.\nExemple:\n{{ config.pages.default.sitemap.priority }}\nsite.menus\nBouclez sur site.menus.&lt;menu&gt; pour obtenir chaque entrée de la collection &lt;menu&gt; (par exemple : main).\n\n\n\nVariables\nDescriptif\n\n\n\n\n&lt;entry&gt;.name\nNom de l'entrée.\n\n\n&lt;entry&gt;.url\nURL d'entrée.\n\n\n&lt;entry&gt;.weight\nPoids d'entrée (utile pour trier les entrées de menu).\n\n\n\nExemple:\n&lt;nav&gt;\n  &lt;ol&gt;\n  {% for entry in site.menus.main|sort_by_weight %}\n    &lt;li&gt;&lt;a href=\"{{ url(entry.url) }}\" data-weight=\"{{ entry.weight }}\"&gt;{{ entry.name }}&lt;\/a&gt;&lt;\/li&gt;\n  {% endfor %}\n  &lt;\/ol&gt;\n&lt;\/nav&gt;\nsite.language\nInformations sur la langue actuelle.\n\n\n\nVariables\nDescriptif\n\n\n\n\nsite.language\nCode de langue (ex. : en).\n\n\nsite.language.name\nNom de la langue (par exemple : English).\n\n\nsite.language.locale\nLangue code local (par exemple : en_US).\n\n\nsite.language.weight\nPosition de la langue dans la liste languages.\n\n\n\nVous pouvez récupérer name, locale et weight d'un langage spécifique en passant son code en paramètre.\npar exemple : site.language.name('fr').\nsite.static\nLa collection de fichiers statiques est accessible via site.static si le static load est activé.\nChaque fichier expose les propriétés suivantes :\n\npath : chemin relatif (ex. : \/images\/img-1.jpg)\ndate : date de création (timestamp)\nupdated : date de modification (timestamp)\nname : nom (ex. : img-1.jpg)\nbasename : nom sans extension (ex. : img-1)\next : poste (ex. : jpg)\ntype : type de média (ex. : image)\nsubtype : sous-type de média (ex. : image\/jpeg)\nexif : données EXIF ​​​​de l'image (array)\naudio : Mp3Info objet\nvideo : tableau d'informations vidéo de base (durée en secondes, largeur et hauteur)\n\nsite.data\nUne collection de données est accessible via site.data.&lt;filename&gt; (sans extension de fichier).\nExemples :\n\ndata\/authors.yml : site.data.authors\ndata\/authors.fr.yml : site.data.authors (si site.language = \"fr\")\ndata\/galleries\/gallery-1.json : site.data.galleries['gallery-1']\n\npage\nLa variable page contient les variables intégrées d'une page et celles définies dans le avant-plan.\n\n\n\nVariables\nDescriptif\nExemple\n\n\n\n\npage.id\nIdentifiant unique.\nblog\/post-1\n\n\npage.title\nNom du fichier (sans extension).\nPost 1\n\n\npage.date\nDate de création du fichier.\nDateHeure\n\n\npage.body\nCorps du fichier.\nMarquage\n\n\npage.content\nCorps du fichier converti en HTML.\nHTML\n\n\npage.section\nDossier racine du fichier (slugified).\nblog\n\n\npage.path\nChemin du fichier (slugified).\nblog\/post-1\n\n\npage.slug\nNom du fichier (slugified).\npost-1\n\n\npage.filepath\nChemin du système de fichiers.\nBlog\/Post 1.md\n\n\npage.type\nhomepage, page, section, vocabulary ou term.\npage\n\n\npage.pages\nCollection de toutes les sous-pages.\nCollection\n\n\npage.translations\nCollection de pages traduites.\nCollection\n\n\n\nUtilisez la méthode showable sur la collection de pages pour renvoyer uniquement les pages publiées et non les pages virtuelles\/redirectes\/exclues.\nExemple:\n{% for page in page.pages.showable %}\n  &lt;a href=\"{{ url(page) }}\"&gt;{{ page.title }}&lt;\/a&gt;\n{% endfor %}\nSections imbriquées\nDans un contexte de sections imbriquées, les propriétés page.parent, page.ancestors, page.sections et page.toplevel facilitent la construction de la navigation.\n\n\n\nVariables\nDescriptif\nExemple\n\n\n\n\npage.parent\nPage de la section parente (null si aucune).\nPage\n\n\npage.ancestors\nCollection des sections ancêtres (la plus proche en premier).\nCollection\n\n\npage.sections\nCollection des sections descendantes immédiates.\nCollection\n\n\npage.toplevel\ntrue si la page est une section de premier niveau.\nBoolean\n\n\n\nFil d'Ariane (de la page d'accueil à la page courante) :\n&lt;nav aria-label=\"breadcrumb\"&gt;\n  &lt;ul&gt;\n    &lt;li&gt;&lt;a href=\"{{ url(site.home) }}\"&gt;{{ site.title }}&lt;\/a&gt;&lt;\/li&gt;\n    {% for section in page.ancestors|reverse %}\n    &lt;li&gt;&lt;a href=\"{{ url(section) }}\"&gt;{{ section.title }}&lt;\/a&gt;&lt;\/li&gt;\n    {% endfor %}\n    {% if page.id != site.home %}\n    &lt;li&gt;&lt;a href=\"{{ url(page) }}\" aria-current=\"page\"&gt;{{ page.title }}&lt;\/a&gt;&lt;\/li&gt;\n    {% endif %}\n  &lt;\/ul&gt;\n&lt;\/nav&gt;\nUn partial breadcrumb.html.twig prêt à l'emploi est disponible :\n{{ include('partials\/breadcrumb.html.twig') }}\nMenu des sous-sections (sections descendantes immédiates de la section courante) :\n{% if page.sections|length %}\n&lt;ul&gt;\n  {% for section in page.sections|sort_by_title %}\n  &lt;li&gt;&lt;a href=\"{{ url(section) }}\"&gt;{{ section.title }}&lt;\/a&gt;&lt;\/li&gt;\n  {% endfor %}\n&lt;\/ul&gt;\n{% endif %}\nNavigation principale limitée aux sections de premier niveau (depuis n'importe quelle page) :\n&lt;nav&gt;\n  {% for section in site.page(site.home).sections|sort_by_title %}\n  &lt;a href=\"{{ url(section) }}\"&gt;{{ section.title }}&lt;\/a&gt;\n  {% endfor %}\n&lt;\/nav&gt;\nLien vers la section parente :\n{% if page.parent %}\n&lt;a href=\"{{ url(page.parent) }}\"&gt;← {{ page.parent.title }}&lt;\/a&gt;\n{% endif %}\npage.&lt;prev\/next&gt;\nNavigation entre les pages d'une même Section, triées selon le sortby de la section (ordre chronologique pour les dates).\nAvec des sous-sections, la navigation suit l'arbre des sections : les pages d'une Section de premier niveau et de toutes ses sous-sections sont enchaînées, chaque sous-section (sa page d'index) étant placée parmi les pages de sa Section parente et suivie de ses propres pages.\n\n\n\nVariables\nDescriptif\nExemple\n\n\n\n\npage.prev\nPage précédente.\nPage\n\n\npage.next\nPage suivante.\nPage\n\n\n\nExemple:\n&lt;a href=\"{{ url(page.prev) }}\"&gt;{{ page.prev.title }}&lt;\/a&gt;\npage.paginator\nPaginator vous aide à créer une navigation pour les pages de la liste : page d'accueil, sections et taxonomies.\n\n\n\nVariables\nDescriptif\n\n\n\n\npage.paginator.pages\nCollection de pages.\n\n\npage.paginator.pages_total\nNombre total de pages.\n\n\npage.paginator.count\nNombre de pages du paginateur.\n\n\npage.paginator.current\nIndex de position de la page actuelle.\n\n\npage.paginator.links.first\nID de page de la première page.\n\n\npage.paginator.links.prev\nID de page de la page précédente.\n\n\npage.paginator.links.self\nID de page de la page actuelle.\n\n\npage.paginator.links.next\nID de page de la page suivante.\n\n\npage.paginator.links.last\nID de page de la dernière page.\n\n\npage.paginator.links.path\nID de page sans l'index de position.\n\n\n\nÉtant donné que les entrées de liens sont des ID de page, vous devez utiliser la fonction url() pour créer des liens fonctionnels.\npar exemple : {{ url(page.paginator.links.next) }}\nExemple:\n{% if page.paginator %}\n&lt;div&gt;\n  {% if page.paginator.links.prev is defined %}\n  &lt;a href=\"{{ url(page.paginator.links.prev) }}\"&gt;Previous&lt;\/a&gt;\n  {% endif %}\n  {% if page.paginator.links.next is defined %}\n  &lt;a href=\"{{ url(page.paginator.links.next) }}\"&gt;Next&lt;\/a&gt;\n  {% endif %}\n&lt;\/div&gt;\n{% endif %}\nExemple:\n{% if page.paginator %}\n&lt;div&gt;\n  {% for paginator_index in 1..page.paginator.count %}\n    {% if paginator_index != page.paginator.current %}\n      {% if paginator_index == 1 %}\n  &lt;a href=\"{{ url(page.paginator.links.first) }}\"&gt;{{ paginator_index }}&lt;\/a&gt;\n      {% else %}\n  &lt;a href=\"{{ url(page.paginator.links.path ~ '\/' ~ paginator_index) }}\"&gt;{{ paginator_index }}&lt;\/a&gt;\n      {% endif %}\n    {% else %}\n  {{ paginator_index }}\n    {% endif %}\n  {% endfor %}\n&lt;\/div&gt;\n{% endif %}\nTaxonomie\nVariables disponibles dans les templates vocabulary et term.\nVocabulaire\nPage \/&lt;plural&gt;\/ (ex. : \/categories\/).\n\n\n\nVariables\nDescriptif\n\n\n\n\npage.plural\nNom de vocabulaire au pluriel.\n\n\npage.singular\nNom de vocabulaire au singulier.\n\n\npage.terms\nListe de termes (Collection).\n\n\n\nChaque terme de page.terms fournit term.id (identifiant du terme, ex. : categories\/php), term.name (nom du terme, ex. : PHP) et le nombre de ses pages avec term|length.\nTerme\nPage \/&lt;plural&gt;\/&lt;term&gt;\/ (ex. : \/categories\/php\/).\n\n\n\nVariables\nDescriptif\n\n\n\n\npage.title\nNom du terme.\n\n\npage.term\nIdentifiant du terme (ex. : categories\/php).\n\n\npage.plural\nNom de vocabulaire au pluriel.\n\n\npage.singular\nNom de vocabulaire au singulier.\n\n\npage.pages\nListe des pages dans ce terme, triées par date (Collection).\n\n\n\nExemple de taxonomie\nConfiguration :\ntaxonomies:\n  categories: category\nFront matter d’une page :\n---\ncategories: [\"Data Sovereignty\"]\n---\nListe des termes (\/categories\/), dans layouts\/taxonomy\/categories.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) }}\"&gt;{{ term.name }}&lt;\/a&gt; ({{ term|length }})&lt;\/li&gt;\n  {% endfor %}\n  &lt;\/ul&gt;\n{% endblock %}\nListe des pages d’un terme (\/categories\/data-sovereignty\/), dans layouts\/taxonomy\/category.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) }}\"&gt;Toutes les {{ page.plural }}&lt;\/a&gt;\n{% endblock %}\nLiens vers les termes de la page courante, dans un template de page :\n{% for category in page.categories ?? [] %}\n  &lt;a href=\"{{ url('categories\/' ~ category) }}\"&gt;{{ category }}&lt;\/a&gt;\n{% endfor %}\nLa fonction url() « slugifie » la chaîne fournie pour trouver la page correspondante : url('categories\/Data Sovereignty') retourne \/categories\/data-sovereignty\/.\nVous pouvez aussi utiliser le partial intégré {{ include('partials\/terms-list.html.twig', {vocabulary: 'categories'}) }}.\ncecil\n\n\n\nVariables\nDescriptif\n\n\n\n\ncecil.url\nURL du site Cecil.\n\n\ncecil.version\nVersion actuelle de Cecil.\n\n\ncecil.poweredby\nImprimez Cecil v%s, avec %s est la version actuelle.\n\n\n",
      "content_html": "<h1>Variables</h1>\n<blockquote>\n<p>L'application transmet des variables aux templates pour manipulation dans le modèle. Les variables peuvent également avoir des attributs ou des éléments auxquels vous pouvez accéder.\nUtilisez un point (.) pour accéder aux attributs d'une variable : <code translate=\"no\">{{ foo.bar }}</code></p>\n</blockquote>\n<p>Vous pouvez utiliser des variables de différentes portées : <a href=\"#site\"><code translate=\"no\">site</code></a>, <a href=\"#page\"><code translate=\"no\">page</code></a>, <a href=\"#cecil\"><code translate=\"no\">cecil</code></a>.</p>\n<h2 id=\"site\">site</h2>\n<p>La variable <code translate=\"no\">site</code> contient des variables intégrées <strong>et</strong> celles définies dans la <a href=\"../configuration/index.fr.md\">configuration</a>.</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">site.pages</code></td>\n<td>Collection de toutes les pages, dans la langue actuelle.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.allpages</code></td>\n<td>Collection de toutes les pages, dans toutes les langues.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.page(id)</code></td>\n<td>Une page avec l'ID donné.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.taxonomies</code></td>\n<td>Recueil de vocabulaires.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.home</code></td>\n<td>ID de la page d'accueil.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.time</code></td>\n<td>Actuel <a href=\"https://wikipedia.org/wiki/Unix_time\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Timestamp</em></a>.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.debug</code></td>\n<td>État du mode débogage (<code translate=\"no\">true</code> ou <code translate=\"no\">false</code>).</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.build</code></td>\n<td>ID de build actuel.</td>\n</tr>\n</tbody>\n</table>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-attr\">title:</span> <span class=\"hljs-string\">\"My amazing website!\"</span></code></pre>\n<p>Peut être affiché dans un modèle avec :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ site.title }}</span></code></pre>\n<aside class=\"note note-important\"><p>Utilisez la méthode <code translate=\"no\">showable</code> sur la collection de pages pour renvoyer uniquement les pages publiées et non les pages <em>virtuelles/redirectes/exclues</em>.</p>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> page in site.pages.showable %}</span><span class=\"xml\">\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) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ page.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span></code></pre></aside>\n<aside class=\"note note-warning\"><p>Dans certains cas, vous pouvez rencontrer des conflits entre la configuration et les variables intégrées (ex. : <code translate=\"no\">pages.default</code> configuration), vous pouvez donc utiliser <code translate=\"no\">config.&lt;variable&gt;</code> (avec <code translate=\"no\">&lt;variable&gt;</code> est le nom/chemin de la variable) pour accéder directement à la configuration brute.</p>\n<p>Exemple:</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ config.pages.default.sitemap.priority }}</span></code></pre></aside>\n<h3 id=\"site-menus\">site.menus</h3>\n<p>Bouclez sur <code translate=\"no\">site.menus.&lt;menu&gt;</code> pour obtenir chaque entrée de la collection <code translate=\"no\">&lt;menu&gt;</code> (par exemple : <code translate=\"no\">main</code>).</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">&lt;entry&gt;.name</code></td>\n<td>Nom de l'entrée.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">&lt;entry&gt;.url</code></td>\n<td>URL d'entrée.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">&lt;entry&gt;.weight</code></td>\n<td>Poids d'entrée (utile pour trier les entrées de menu).</td>\n</tr>\n</tbody>\n</table>\n<p><em>Exemple:</em></p>\n<pre><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\">ol</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><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">a</span> <span class=\"hljs-attr\">href</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ url(entry.url) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span> <span class=\"hljs-attr\">data-weight</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ entry.weight }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ entry.name }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">li</span>&gt;</span>\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\">ol</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">nav</span>&gt;</span></span></code></pre>\n<h3 id=\"site-language\">site.language</h3>\n<p>Informations sur la langue actuelle.</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">site.language</code></td>\n<td>Code de langue (ex. : <code translate=\"no\">en</code>).</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.language.name</code></td>\n<td>Nom de la langue (par exemple : <code translate=\"no\">English</code>).</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.language.locale</code></td>\n<td>Langue <a href=\"../configuration/3-locale-codes.fr.md\">code local</a> (par exemple : <code translate=\"no\">en_US</code>).</td>\n</tr>\n<tr>\n<td><code translate=\"no\">site.language.weight</code></td>\n<td>Position de la langue dans la liste <code translate=\"no\">languages</code>.</td>\n</tr>\n</tbody>\n</table>\n<aside class=\"note note-tip\"><p>Vous pouvez récupérer <code translate=\"no\">name</code>, <code translate=\"no\">locale</code> et <code translate=\"no\">weight</code> d'un langage spécifique en passant son code en paramètre.\npar exemple : <code translate=\"no\">site.language.name('fr')</code>.</p></aside>\n<h3 id=\"site-static\">site.static</h3>\n<p>La collection de fichiers statiques est accessible via <code translate=\"no\">site.static</code> si le <a href=\"../configuration/5-data-static.fr.md#static-load\"><em>static load</em></a> est activé.</p>\n<p>Chaque fichier expose les propriétés suivantes :</p>\n<ul>\n<li><code translate=\"no\">path</code> : chemin relatif (ex. : <code translate=\"no\">/images/img-1.jpg</code>)</li>\n<li><code translate=\"no\">date</code> : date de création (<em>timestamp</em>)</li>\n<li><code translate=\"no\">updated</code> : date de modification (<em>timestamp</em>)</li>\n<li><code translate=\"no\">name</code> : nom (ex. : <code translate=\"no\">img-1.jpg</code>)</li>\n<li><code translate=\"no\">basename</code> : nom sans extension (ex. : <code translate=\"no\">img-1</code>)</li>\n<li><code translate=\"no\">ext</code> : poste (ex. : <code translate=\"no\">jpg</code>)</li>\n<li><code translate=\"no\">type</code> : type de média (ex. : <code translate=\"no\">image</code>)</li>\n<li><code translate=\"no\">subtype</code> : sous-type de média (ex. : <code translate=\"no\">image/jpeg</code>)</li>\n<li><code translate=\"no\">exif</code> : données EXIF ​​​​de l'image (<em>array</em>)</li>\n<li><code translate=\"no\">audio</code> : <a href=\"https://github.com/wapmorgan/Mp3Info#audio-information\" target=\"_blank\" rel=\"noopener noreferrer\">Mp3Info</a> objet</li>\n<li><code translate=\"no\">video</code> : tableau d'informations vidéo de base (durée en secondes, largeur et hauteur)</li>\n</ul>\n<h3 id=\"site-data\">site.data</h3>\n<p>Une collection de données est accessible via <code translate=\"no\">site.data.&lt;filename&gt;</code> (sans extension de fichier).</p>\n<p><em>Exemples :</em></p>\n<ul>\n<li><code translate=\"no\">data/authors.yml</code> : <code translate=\"no\">site.data.authors</code></li>\n<li><code translate=\"no\">data/authors.fr.yml</code> : <code translate=\"no\">site.data.authors</code> (si <code translate=\"no\">site.language</code> = \"fr\")</li>\n<li><code translate=\"no\">data/galleries/gallery-1.json</code> : <code translate=\"no\">site.data.galleries['gallery-1']</code></li>\n</ul>\n<h2 id=\"page\">page</h2>\n<p>La variable <code translate=\"no\">page</code> contient les variables intégrées d'une page <strong>et</strong> celles définies dans le <a href=\"../content/1-pages.fr.md#front-matter\">avant-plan</a>.</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n<th>Exemple</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">page.id</code></td>\n<td>Identifiant unique.</td>\n<td><code translate=\"no\">blog/post-1</code></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.title</code></td>\n<td>Nom du fichier (sans extension).</td>\n<td><code translate=\"no\">Post 1</code></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.date</code></td>\n<td>Date de création du fichier.</td>\n<td><em>DateHeure</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.body</code></td>\n<td>Corps du fichier.</td>\n<td><em>Marquage</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.content</code></td>\n<td>Corps du fichier converti en HTML.</td>\n<td><em>HTML</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.section</code></td>\n<td>Dossier racine du fichier (<em>slugified</em>).</td>\n<td><code translate=\"no\">blog</code></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.path</code></td>\n<td>Chemin du fichier (<em>slugified</em>).</td>\n<td><code translate=\"no\">blog/post-1</code></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.slug</code></td>\n<td>Nom du fichier (<em>slugified</em>).</td>\n<td><code translate=\"no\">post-1</code></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.filepath</code></td>\n<td>Chemin du système de fichiers.</td>\n<td><code translate=\"no\">Blog/Post 1.md</code></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.type</code></td>\n<td><code translate=\"no\">homepage</code>, <code translate=\"no\">page</code>, <code translate=\"no\">section</code>, <code translate=\"no\">vocabulary</code> ou <code translate=\"no\">term</code>.</td>\n<td><code translate=\"no\">page</code></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.pages</code></td>\n<td>Collection de toutes les sous-pages.</td>\n<td><em>Collection</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.translations</code></td>\n<td>Collection de pages traduites.</td>\n<td><em>Collection</em></td>\n</tr>\n</tbody>\n</table>\n<aside class=\"note note-important\"><p>Utilisez la méthode <code translate=\"no\">showable</code> sur la collection de pages pour renvoyer uniquement les pages publiées et non les pages <em>virtuelles/redirectes/exclues</em>.</p>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> page in page.pages.showable %}</span><span class=\"xml\">\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) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ page.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span></code></pre></aside>\n<h3 id=\"sections-imbriquees\">Sections imbriquées</h3>\n<p>Dans un contexte de <a href=\"../content/1-pages.fr.md#sous-section\">sections imbriquées</a>, les propriétés <code translate=\"no\">page.parent</code>, <code translate=\"no\">page.ancestors</code>, <code translate=\"no\">page.sections</code> et <code translate=\"no\">page.toplevel</code> facilitent la construction de la navigation.</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n<th>Exemple</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">page.parent</code></td>\n<td>Page de la <em>section</em> parente (<code translate=\"no\">null</code> si aucune).</td>\n<td><em>Page</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.ancestors</code></td>\n<td>Collection des <em>sections</em> ancêtres (la plus proche en premier).</td>\n<td><em>Collection</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.sections</code></td>\n<td>Collection des <em>sections</em> descendantes immédiates.</td>\n<td><em>Collection</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.toplevel</code></td>\n<td><code translate=\"no\">true</code> si la page est une <em>section</em> de premier niveau.</td>\n<td><em>Boolean</em></td>\n</tr>\n</tbody>\n</table>\n<p><em>Fil d'Ariane (de la page d'accueil à la page courante) :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">nav</span> <span class=\"hljs-attr\">aria-label</span>=<span class=\"hljs-string\">\"breadcrumb\"</span>&gt;</span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul</span>&gt;</span>\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(site.home) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ site.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">li</span>&gt;</span>\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> section in page.ancestors|<span class=\"hljs-keyword\">reverse</span> %}</span><span class=\"xml\">\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(section) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ section.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">li</span>&gt;</span>\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-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">if</span></span> page.id != site.home %}</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(page) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span> <span class=\"hljs-attr\">aria-current</span>=<span class=\"hljs-string\">\"page\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ page.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">li</span>&gt;</span>\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\">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-tip\"><p>Un partial <a href=\"https://github.com/Cecilapp/Cecil/blob/main/resources/layouts/partials/breadcrumb.html.twig\" target=\"_blank\" rel=\"noopener noreferrer\"><code translate=\"no\">breadcrumb.html.twig</code></a> prêt à l'emploi est disponible :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ <span class=\"hljs-name\">include</span><span class=\"hljs-params\">('partials/breadcrumb.html.twig')</span> }}</span></code></pre></aside>\n<p><em>Menu des sous-sections (sections descendantes immédiates de la section courante) :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">if</span></span> page.sections|<span class=\"hljs-keyword\">length</span> %}</span><span class=\"xml\">\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> section in page.sections|sort_by_title %}</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(section) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ section.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">li</span>&gt;</span>\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\">endif</span></span> %}</span></code></pre>\n<p><em>Navigation principale limitée aux sections de premier niveau (depuis n'importe quelle page) :</em></p>\n<pre><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><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> section in site.page(site.home).sections|sort_by_title %}</span><span class=\"xml\">\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(section) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ section.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\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></span></code></pre>\n<p><em>Lien vers la section parente :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">if</span></span> page.<span class=\"hljs-name\">parent</span> %}</span><span class=\"xml\">\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.<span class=\"hljs-name\">parent</span>) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span>← </span><span class=\"hljs-template-variable\">{{ page.<span class=\"hljs-name\">parent</span>.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endif</span></span> %}</span></code></pre>\n<h3 id=\"page-prev-next\">page.&lt;prev/next&gt;</h3>\n<p>Navigation entre les pages d'une même <em>Section</em>, triées selon le <code translate=\"no\">sortby</code> de la section (ordre chronologique pour les dates).</p>\n<p>Avec des <a href=\"../content/1-pages.fr.md#sous-section\">sous-sections</a>, la navigation suit l'arbre des sections : les pages d'une <em>Section</em> de premier niveau et de toutes ses sous-sections sont enchaînées, chaque sous-section (sa page d'index) étant placée parmi les pages de sa <em>Section</em> parente et suivie de ses propres pages.</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n<th>Exemple</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">page.prev</code></td>\n<td>Page précédente.</td>\n<td><em>Page</em></td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.next</code></td>\n<td>Page suivante.</td>\n<td><em>Page</em></td>\n</tr>\n</tbody>\n</table>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">a</span> <span class=\"hljs-attr\">href</span>=<span class=\"hljs-string\">\"</span></span></span><span class=\"hljs-template-variable\">{{ url(page.prev) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ page.prev.title }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span></span></code></pre>\n<h3 id=\"page-paginator\">page.paginator</h3>\n<p><em>Paginator</em> vous aide à créer une navigation pour les pages de la liste : page d'accueil, sections et taxonomies.</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">page.paginator.pages</code></td>\n<td>Collection de pages.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.pages_total</code></td>\n<td>Nombre total de pages.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.count</code></td>\n<td>Nombre de pages du paginateur.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.current</code></td>\n<td>Index de position de la page actuelle.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.links.first</code></td>\n<td>ID de page de la première page.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.links.prev</code></td>\n<td>ID de page de la page précédente.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.links.self</code></td>\n<td>ID de page de la page actuelle.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.links.next</code></td>\n<td>ID de page de la page suivante.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.links.last</code></td>\n<td>ID de page de la dernière page.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.paginator.links.path</code></td>\n<td>ID de page sans l'index de position.</td>\n</tr>\n</tbody>\n</table>\n<aside class=\"note note-important\"><p>Étant donné que les entrées de liens sont des ID de page, vous devez utiliser la fonction <code translate=\"no\">url()</code> pour créer des liens fonctionnels.\npar exemple : <code translate=\"no\">{{ url(page.paginator.links.next) }}</code></p></aside>\n<p><em>Exemple:</em></p>\n<pre><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\">div</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>&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><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>&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\">div</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><em>Exemple:</em></p>\n<pre><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\">div</span>&gt;</span>\n  </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> paginator_index in 1..page.paginator.count %}</span><span class=\"xml\">\n    </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">if</span></span> paginator_index != page.paginator.current %}</span><span class=\"xml\">\n      </span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">if</span></span> paginator_index == 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\">{{ paginator_index }}</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 ~ '/' ~ paginator_index) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ paginator_index }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\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\">else</span> %}</span><span class=\"xml\">\n  </span><span class=\"hljs-template-variable\">{{ paginator_index }}</span><span class=\"xml\">\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\">div</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<h3 id=\"taxonomie\">Taxonomie</h3>\n<p>Variables disponibles dans les templates <em>vocabulary</em> et <em>term</em>.</p>\n<h4>Vocabulaire</h4>\n<p>Page <code translate=\"no\">/&lt;plural&gt;/</code> (ex. : <code translate=\"no\">/categories/</code>).</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">page.plural</code></td>\n<td>Nom de vocabulaire au pluriel.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.singular</code></td>\n<td>Nom de vocabulaire au singulier.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.terms</code></td>\n<td>Liste de termes (<em>Collection</em>).</td>\n</tr>\n</tbody>\n</table>\n<p>Chaque terme de <code translate=\"no\">page.terms</code> fournit <code translate=\"no\">term.id</code> (identifiant du terme, ex. : <code translate=\"no\">categories/php</code>), <code translate=\"no\">term.name</code> (nom du terme, ex. : <code translate=\"no\">PHP</code>) et le nombre de ses pages avec <code translate=\"no\">term|length</code>.</p>\n<h4>Terme</h4>\n<p>Page <code translate=\"no\">/&lt;plural&gt;/&lt;term&gt;/</code> (ex. : <code translate=\"no\">/categories/php/</code>).</p>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">page.title</code></td>\n<td>Nom du terme.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.term</code></td>\n<td>Identifiant du terme (ex. : <code translate=\"no\">categories/php</code>).</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.plural</code></td>\n<td>Nom de vocabulaire au pluriel.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.singular</code></td>\n<td>Nom de vocabulaire au singulier.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">page.pages</code></td>\n<td>Liste des pages dans ce terme, triées par date (<em>Collection</em>).</td>\n</tr>\n</tbody>\n</table>\n<h4>Exemple de taxonomie</h4>\n<p>Configuration :</p>\n<pre><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></code></pre>\n<p>Front matter d’une page :</p>\n<pre><code class=\"language-yaml hljs yaml\" translate=\"no\"><span class=\"hljs-meta\">---</span>\n<span class=\"hljs-attr\">categories:</span> <span class=\"hljs-string\">[\"Data</span> <span class=\"hljs-string\">Sovereignty\"]</span>\n<span class=\"hljs-meta\">---</span></code></pre>\n<p>Liste des termes (<code translate=\"no\">/categories/</code>), dans <code translate=\"no\">layouts/taxonomy/categories.html.twig</code> :</p>\n<pre><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) }}</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<p>Liste des pages d’un terme (<code translate=\"no\">/categories/data-sovereignty/</code>), dans <code translate=\"no\">layouts/taxonomy/category.html.twig</code> :</p>\n<pre><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) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span>Toutes les </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<p>Liens vers les termes de la page courante, dans un template de page :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">for</span></span> category in page.categories ?? [] %}</span><span class=\"xml\">\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('categories/' ~ category) }}</span><span class=\"xml\"><span class=\"hljs-tag\"><span class=\"hljs-string\">\"</span>&gt;</span></span><span class=\"hljs-template-variable\">{{ category }}</span><span class=\"xml\"><span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">a</span>&gt;</span>\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endfor</span></span> %}</span></code></pre>\n<aside class=\"note note-tip\"><p>La fonction <a href=\"reference/1-functions.fr.md#url\"><code translate=\"no\">url()</code></a> « slugifie » la chaîne fournie pour trouver la page correspondante : <code translate=\"no\">url('categories/Data Sovereignty')</code> retourne <code translate=\"no\">/categories/data-sovereignty/</code>.</p>\n<p>Vous pouvez aussi utiliser le partial intégré <code translate=\"no\">{{ include('partials/terms-list.html.twig', {vocabulary: 'categories'}) }}</code>.</p></aside>\n<h2 id=\"cecil\">cecil</h2>\n<table>\n<thead>\n<tr>\n<th>Variables</th>\n<th>Descriptif</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code translate=\"no\">cecil.url</code></td>\n<td>URL du site Cecil.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">cecil.version</code></td>\n<td>Version actuelle de Cecil.</td>\n</tr>\n<tr>\n<td><code translate=\"no\">cecil.poweredby</code></td>\n<td>Imprimez <code translate=\"no\">Cecil v%s</code>, avec <code translate=\"no\">%s</code> est la version actuelle.</td>\n</tr>\n</tbody>\n</table>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/reference/tris/",
      "url": "https://cecil.app/fr/documentation/templates/reference/tris/",
      "title": "Tris",
      "summary": "Triez des collections de pages, menus ou taxonomies.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Tris\nTri des collections (de pages, menus ou taxonomies).\nsort_by_title\nTrie une collection par titre (avec tri naturel).\n{{ collection|sort_by_title }}\nExemple:\n{{ site.pages|sort_by_title }}\nsort_by_date\nTrie une collection par date (la plus récente en premier).\n{{ collection|sort_by_date(variable='date', desc_title=false) }}\nExemple:\n{# sort by date #}\n{{ site.pages|sort_by_date }}\n{# sort by updated variable instead of date #}\n{{ site.pages|sort_by_date(variable='updated') }}\n{# sort items with the same date by desc title #}\n{{ site.pages|sort_by_date(desc_title=true) }}\n{# reverse sort #}\n{{ site.pages|sort_by_date|reverse }}\nsort_by_weight\nTrie une collection par poids (le plus léger en premier).\n{{ collection|sort_by_weight }}\nExemple:\n{{ site.menus.main|sort_by_weight }}\nsort\nPour les cas plus complexes, vous devez utiliser le sort natif de Twig.\nExemple:\n{% set files = site.static|sort((a, b) =&gt; a.date|date('U') &lt; b.date|date('U')) %}",
      "content_html": "<h1>Tris</h1>\n<p>Tri des collections (de pages, menus ou taxonomies).</p>\n<h2 id=\"sort-by-title\">sort_by_title</h2>\n<p>Trie une collection par titre (avec <a href=\"https://en.wikipedia.org/wiki/Natural_sort_order\" target=\"_blank\" rel=\"noopener noreferrer\">tri naturel</a>).</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ collection|sort_by_title }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ site.pages|sort_by_title }}</span></code></pre>\n<h2 id=\"sort-by-date\">sort_by_date</h2>\n<p>Trie une collection par date (la plus récente en premier).</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ collection|sort_by_date(variable='<span class=\"hljs-name\">date</span>', desc_title=false) }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# sort by date #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ site.pages|sort_by_date }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# sort by updated variable instead of date #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ site.pages|sort_by_date(variable='updated') }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# sort items with the same date by desc title #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ site.pages|sort_by_date(desc_title=true) }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# reverse sort #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ site.pages|sort_by_date|<span class=\"hljs-keyword\">reverse</span> }}</span></code></pre>\n<h2 id=\"sort-by-weight\">sort_by_weight</h2>\n<p>Trie une collection par poids (le plus léger en premier).</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ collection|sort_by_weight }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ site.menus.main|sort_by_weight }}</span></code></pre>\n<h2 id=\"sort\">sort</h2>\n<p>Pour les cas plus complexes, vous devez utiliser <a href=\"https://twig.symfony.com/doc/filters/sort.html\" target=\"_blank\" rel=\"noopener noreferrer\">le <code translate=\"no\">sort</code></a> natif de Twig.</p>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> files = site.static|<span class=\"hljs-keyword\">sort</span>((a, b) =&gt; a.<span class=\"hljs-name\">date</span>|<span class=\"hljs-keyword\">date</span>('U') &lt; b.<span class=\"hljs-name\">date</span>|<span class=\"hljs-keyword\">date</span>('U')) %}</span></code></pre>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/reference/filtres/",
      "url": "https://cecil.app/fr/documentation/templates/reference/filtres/",
      "title": "Filtres",
      "summary": "filter_by, markdown_to_html, toc, slugify, excerpt, highlight, preg_*, etc.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Filtres\nLes variables peuvent être modifiées par filtres. Les filtres sont séparés de la variable par un symbole de barre verticale (|). Plusieurs filtres peuvent être chaînés. La sortie d’un filtre est appliquée au suivant.\n{{ page.title|truncate(25)|capitalize }}\nfilter_by\nFiltre une collection de pages par nom\/valeur de variable.\n{{ collection|filter_by(variable, value) }}\nExemple:\n{{ pages|filter_by('section', 'blog') }}\nfilter\nPour les cas plus complexes, vous devez utiliser le filter natif de Twig.\nExemple:\n{% pages|filter(p =&gt; p.virtual == false and p.id not in ['page-1', 'page-2']) %}\nmarkdown_to_html\nConvertit une chaîne Markdown en HTML.\n{{ markdown|markdown_to_html }}\n{% apply markdown_to_html %}\n{# Markdown here #}\n{% endapply %}\nExemples :\n{% set markdown = '**This is bold text**' %}\n{{ markdown|markdown_to_html }}\n{% apply markdown_to_html %}\n**This is bold text**\n{% endapply %}\ntoc\nExtrait uniquement les en-têtes correspondant au selectors donné (h2, h3, etc.), ou à ceux définis dans la configuration pages.body.toc s'ils ne sont pas spécifiés.\nLe paramètre format définit le format de sortie : html ou json.\nLe paramètre url est utilisé pour créer des liens vers des titres.\n{{ markdown|toc(format, selectors, url) }}\nExemples :\n{{ page.body|toc }}\n{{ page.body|toc('html') }}\n{{ page.body|toc(selectors=['h2']) }}\n{{ page.body|toc(url=url(page)) }}\njson_decode\nConvertit une chaîne JSON en tableau.\n{{ json|json_decode }}\nExemple:\n{% set json = '{\"foo\": \"bar\"}' %}\n{% set array = json|json_decode %}\n{{ array.foo }}\nyaml_parse\nConvertit une chaîne YAML en tableau.\n{{ yaml|yaml_parse }}\nExemple:\n{% set yaml = 'key: value' %}\n{% set array = yaml|yaml_parse %}\n{{ array.key }}\nslugify\nConvertit une chaîne en slug.\n{{ string|slugify }}\nu\nLe filtre u enveloppe un texte dans un objet Unicode (une instance Symfony UnicodeString) qui expose des méthodes pour « manipuler » la chaîne.\nExemple:\n{{ 'cecil_string with twig'|u.camel.title }}\n\nCecilStringAvecTwig\n\nsingular\nLe filtre singular transforme un nom donné au pluriel en sa version singulière.\n{{ string|singular(locale)}}\nExemple:\n{# English (en) rules are used by default #}\n{{ 'partitions'|singular }}\n\npartition\n\n{{ 'partitions'|singular('fr') }}\n\npartition\n\nplural\nLe filtre plural transforme un nom donné au singulier en sa version plurielle.\n{{ string|plural(locale)}}\nExemple:\n{# English (en) rules are used by default #}\n{{ 'animal'|plural }}\n\nanimaux\n\n{{ 'animal'|plural('fr') }}\n\nanimaux\n\nexcerpt\nTronque une chaîne et ajoute un suffixe.\n{{ string|excerpt(length, suffix) }}\n\n\n\nOptions\nDescriptif\nTapez\nPar défaut\n\n\n\n\nlongueur\nTronque après ce nombre de caractères.\nentier\n450\n\n\nsuffixe\nAjoute des caractères.\nchaîne\n…\n\n\n\nExemples :\n{{ variable|excerpt }}\n{{ variable|excerpt(250, '...') }}\nexcerpt_html\nLit les caractères avant ou après la balise &lt;!-- excerpt --&gt; ou &lt;!-- break --&gt;.\nVoir Documentation de contenu pour plus de détails.\n{{ string|excerpt_html({separator, capture}) }}\n\n\n\nOptions\nDescriptif\nTapez\nPar défaut\n\n\n\n\nséparateur\nChaîne à utiliser comme séparateur.\nchaîne\nexcerpt|break\n\n\ncapturer\nPièce à capturer, before ou after le séparateur.\nchaîne\nbefore\n\n\n\nExemples :\n{{ variable|excerpt_html }}\n{{ variable|excerpt_html({separator: 'excerpt|break', capture: 'before'}) }}\n{{ variable|excerpt_html({capture: 'after'}) }}\nhighlight\nMet en surbrillance une chaîne de code avec highlight.php.\n{{ code|highlight(language) }}\nExemples :\n{{ '&lt;?php echo $highlighted-&gt;value; ?&gt;'|highlight('php') }}\npreg_split\nDivise une chaîne en un tableau à l'aide d'une expression régulière.\n{{ string|preg_split(pattern, limit) }}\nExemple:\n{% set headers = page.content|preg_split('\/&lt;br[^&gt;]*&gt;\/') %}\npreg_match_all\nEffectue une correspondance d'expression régulière et renvoie le groupe pour toutes les correspondances.\n{{ string|preg_match_all(pattern, group) }}\nExemple:\n{% set tags = page.content|preg_match_all('\/&lt;[^&gt;]+&gt;(.*)&lt;\\\/[^&gt;]+&gt;\/') %}\nhex_to_rgb\nConvertit une couleur hexadécimale en RVB.\n{{ color|hex_to_rgb }}",
      "content_html": "<h1>Filtres</h1>\n<p>Les variables peuvent être modifiées par <a href=\"https://twig.symfony.com/doc/filters/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">filtres</a>. Les filtres sont séparés de la variable par un symbole de barre verticale (<code translate=\"no\">|</code>). Plusieurs filtres peuvent être chaînés. La sortie d’un filtre est appliquée au suivant.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ page.title|truncate(25)|<span class=\"hljs-keyword\">capitalize</span> }}</span></code></pre>\n<h2 id=\"filter-by\">filter_by</h2>\n<p>Filtre une collection de pages par nom/valeur de variable.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ collection|filter_by(variable, value) }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ pages|filter_by('section', 'blog') }}</span></code></pre>\n<h2 id=\"filter\">filter</h2>\n<p>Pour les cas plus complexes, vous devez utiliser <a href=\"https://twig.symfony.com/doc/filters/filter.html\" target=\"_blank\" rel=\"noopener noreferrer\">le <code translate=\"no\">filter</code></a> natif de Twig.</p>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">pages</span>|<span class=\"hljs-keyword\">filter</span>(p =&gt; p.virtual == false and p.id not in ['page-1', 'page-2']) %}</span></code></pre>\n<h2 id=\"markdown-to-html\">markdown_to_html</h2>\n<p>Convertit une chaîne Markdown en HTML.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ markdown|markdown_to_html }}</span></code></pre>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">apply</span></span> markdown_to_html %}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# Markdown here #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endapply</span></span> %}</span></code></pre>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> markdown = '**This is bold text**' %}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ markdown|markdown_to_html }}</span></code></pre>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">apply</span></span> markdown_to_html %}</span><span class=\"xml\">\n**This is bold text**\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">endapply</span></span> %}</span></code></pre>\n<h2 id=\"toc\">toc</h2>\n<p>Extrait uniquement les en-têtes correspondant au <code translate=\"no\">selectors</code> donné (h2, h3, etc.), ou à ceux définis dans la configuration <code translate=\"no\">pages.body.toc</code> s'ils ne sont pas spécifiés.\nLe paramètre <code translate=\"no\">format</code> définit le format de sortie : <code translate=\"no\">html</code> ou <code translate=\"no\">json</code>.\nLe paramètre <code translate=\"no\">url</code> est utilisé pour créer des liens vers des titres.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ markdown|toc(format, selectors, url) }}</span></code></pre>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ page.body|toc }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ page.body|toc('html') }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ page.body|toc(selectors=['h2']) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ page.body|toc(url=url(page)) }}</span></code></pre>\n<h2 id=\"json-decode\">json_decode</h2>\n<p>Convertit une chaîne JSON en tableau.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ json|json_decode }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> json = '{\"foo\": \"bar\"}' %}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> array = json|json_decode %}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ array.foo }}</span></code></pre>\n<h2 id=\"yaml-parse\">yaml_parse</h2>\n<p>Convertit une chaîne YAML en tableau.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ yaml|yaml_parse }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> yaml = 'key: value' %}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> array = yaml|yaml_parse %}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ array.key }}</span></code></pre>\n<h2 id=\"slugify\">slugify</h2>\n<p>Convertit une chaîne en slug.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ string|slugify }}</span></code></pre>\n<h2 id=\"u\">u</h2>\n<p>Le filtre <code translate=\"no\">u</code> enveloppe un texte dans un objet Unicode (une <a href=\"https://symfony.com/doc/current/components/string.html\" target=\"_blank\" rel=\"noopener noreferrer\">instance Symfony UnicodeString</a>) qui expose des méthodes pour « manipuler » la chaîne.</p>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ 'cecil_string with twig'|u.camel.title }}</span></code></pre>\n<blockquote>\n<p>CecilStringAvecTwig</p>\n</blockquote>\n<h2 id=\"singular\">singular</h2>\n<p>Le filtre <code translate=\"no\">singular</code> transforme un nom donné au pluriel en sa version singulière.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ string|singular(locale)}}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# English (en) rules are used by default #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ 'partitions'|singular }}</span></code></pre>\n<blockquote>\n<p>partition</p>\n</blockquote>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ 'partitions'|singular('fr') }}</span></code></pre>\n<blockquote>\n<p>partition</p>\n</blockquote>\n<h2 id=\"plural\">plural</h2>\n<p>Le filtre <code translate=\"no\">plural</code> transforme un nom donné au singulier en sa version plurielle.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ string|plural(locale)}}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# English (en) rules are used by default #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ 'animal'|plural }}</span></code></pre>\n<blockquote>\n<p>animaux</p>\n</blockquote>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ 'animal'|plural('fr') }}</span></code></pre>\n<blockquote>\n<p>animaux</p>\n</blockquote>\n<h2 id=\"excerpt\">excerpt</h2>\n<p>Tronque une chaîne et ajoute un suffixe.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ string|excerpt(length, suffix) }}</span></code></pre>\n<table>\n<thead>\n<tr>\n<th>Options</th>\n<th>Descriptif</th>\n<th>Tapez</th>\n<th>Par défaut</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>longueur</td>\n<td>Tronque après ce nombre de caractères.</td>\n<td>entier</td>\n<td>450</td>\n</tr>\n<tr>\n<td>suffixe</td>\n<td>Ajoute des caractères.</td>\n<td>chaîne</td>\n<td><code translate=\"no\">…</code></td>\n</tr>\n</tbody>\n</table>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ variable|excerpt }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ variable|excerpt(250, '...') }}</span></code></pre>\n<h2 id=\"excerpt-html\">excerpt_html</h2>\n<p>Lit les caractères avant ou après la balise <code translate=\"no\">&lt;!-- excerpt --&gt;</code> ou <code translate=\"no\">&lt;!-- break --&gt;</code>.\nVoir <a href=\"../../content/3-markdown.fr.md#extrait\">Documentation de contenu</a> pour plus de détails.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ string|excerpt_html({separator, capture}) }}</span></code></pre>\n<table>\n<thead>\n<tr>\n<th>Options</th>\n<th>Descriptif</th>\n<th>Tapez</th>\n<th>Par défaut</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>séparateur</td>\n<td>Chaîne à utiliser comme séparateur.</td>\n<td>chaîne</td>\n<td><code translate=\"no\">excerpt|break</code></td>\n</tr>\n<tr>\n<td>capturer</td>\n<td>Pièce à capturer, <code translate=\"no\">before</code> ou <code translate=\"no\">after</code> le séparateur.</td>\n<td>chaîne</td>\n<td><code translate=\"no\">before</code></td>\n</tr>\n</tbody>\n</table>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ variable|excerpt_html }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ variable|excerpt_html({separator: 'excerpt|break', capture: 'before'}) }}</span><span class=\"xml\">\n</span><span class=\"hljs-template-variable\">{{ variable|excerpt_html({capture: 'after'}) }}</span></code></pre>\n<h2 id=\"highlight\">highlight</h2>\n<p>Met en surbrillance une chaîne de code avec <a href=\"https://github.com/scrivo/highlight.php\" target=\"_blank\" rel=\"noopener noreferrer\">highlight.php</a>.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ code|highlight(language) }}</span></code></pre>\n<p><em>Exemples :</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ '&lt;?php echo $highlighted-&gt;value; ?&gt;'|highlight('php') }}</span></code></pre>\n<h2 id=\"preg-split\">preg_split</h2>\n<p>Divise une chaîne en un tableau à l'aide d'une expression régulière.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ string|preg_split(pattern, limit) }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> headers = page.content|preg_split('/&lt;br[^&gt;]*&gt;/') %}</span></code></pre>\n<h2 id=\"preg-match-all\">preg_match_all</h2>\n<p>Effectue une correspondance d'expression régulière et renvoie le groupe pour toutes les correspondances.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ string|preg_match_all(pattern, group) }}</span></code></pre>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\"><span class=\"hljs-keyword\">set</span></span> tags = page.content|preg_match_all('/&lt;[^&gt;]+&gt;(.*)&lt;\\/[^&gt;]+&gt;/') %}</span></code></pre>\n<h2 id=\"hex-to-rgb\">hex_to_rgb</h2>\n<p>Convertit une couleur hexadécimale en RVB.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ color|hex_to_rgb }}</span></code></pre>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/composants/",
      "url": "https://cecil.app/fr/documentation/templates/composants/",
      "title": "Composants",
      "summary": "Créez des composants de template réutilisables.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Composants\nCecil fournit une logique de composants pour vous donner le pouvoir de créer des \"unités\" de templates réutilisables.\nLa fonctionnalité des composants est fournie par l'extension de composants Twig créée par Giorgio Pogliani.\nSyntaxe des composants\nLes composants ne sont que des templates Twig stockés dans le sous-répertoire components\/ et peuvent être utilisés n'importe où dans vos templates :\n{# \/components\/button.twig #}\n&lt;button {{ attributes.merge({class: 'rounded px-4'}) }}&gt;\n    {{ slot }}\n&lt;\/button&gt;\n\nLa variable slot correspond à tout contenu que vous ajouterez entre la balise d'ouverture et la balise de fermeture.\n\nPour accéder à un composant vous devez utiliser la balise dédiée x suivie de : et du nom de fichier de votre composant sans extension :\n{# \/index.twig #}\n{% x:button with {class: 'text-white'} %}\n    &lt;strong&gt;Click me&lt;\/strong&gt;\n{% endx %}\nIl rendra :\n&lt;button class=\"text-white rounded px-4\"&gt;\n    &lt;strong&gt;Click me&lt;\/strong&gt;\n&lt;\/button&gt;",
      "content_html": "<h1>Composants</h1>\n<p>Cecil fournit une logique de composants pour vous donner le pouvoir de créer des \"unités\" de templates réutilisables.</p>\n<aside class=\"note note-info\"><p>La fonctionnalité des composants est fournie par l'<a href=\"https://github.com/giorgiopogliani/twig-components\" target=\"_blank\" rel=\"noopener noreferrer\"><em>extension de composants Twig</em></a> créée par Giorgio Pogliani.</p></aside>\n<h2 id=\"syntaxe-des-composants\">Syntaxe des composants</h2>\n<p>Les composants ne sont que des templates Twig stockés dans le sous-répertoire <code translate=\"no\">components/</code> et peuvent être utilisés n'importe où dans vos templates :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# /components/button.twig #}</span><span class=\"xml\">\n<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<blockquote>\n<p>La variable slot correspond à tout contenu que vous ajouterez entre la balise d'ouverture et la balise de fermeture.</p>\n</blockquote>\n<p>Pour accéder à un composant vous devez utiliser la balise dédiée <code translate=\"no\">x</code> suivie de <code translate=\"no\">:</code> et du nom de fichier de votre composant sans extension :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-comment\">{# /index.twig #}</span><span class=\"xml\">\n</span><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>Il rendra :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"xml\"><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></span></code></pre>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/localisation/",
      "url": "https://cecil.app/fr/documentation/templates/localisation/",
      "title": "Localisation",
      "summary": "Traduisez les textes et localisez les dates dans les templates.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Localisation\nCecil prend en charge traduction du texte et localisation de la date.\nTraduction de texte\nUtilise le trans tag ou filter pour traduire des textes dans des templates.\n{% trans with variables into locale %}{% endtrans %}\n{{ message|trans(variables = []) }}\nExemples\n{% trans %}Hello World!{% endtrans %}\n{{ message|trans }}\nInclure des variables :\n{% trans with {'%name%': 'Arnaud'} %}Hello %name%!{% endtrans %}\n{{ message|trans({'%name%': 'Arnaud'}) }}\nForcer les paramètres régionaux :\n{% trans into 'fr_FR' %}Hello World!{% endtrans %}\nPluraliser :\n{% trans with {'%count%': 42}%}{0}I don't have apples|{1}I have one apple|]1,Inf[I have %count% apples{% endtrans %}\nFichiers de traduction\nLes fichiers de traduction doivent être nommés messages.&lt;locale&gt;.&lt;extension&gt; et stockés dans le répertoire translations.\nLes extensions prises en charge sont définies pour chaque format de traduction dans layouts.translations.formats.\nLe code locale (ex. : fr_FR) d'une langue est défini dans les entrées languages de la configuration.\nExemple:\n&lt;mywebsite&gt;\n└─ translations\n   ├─ messages.fr_FR.mo   &lt;- Machine Object format\n   └─ messages.fr_FR.yaml &lt;- Yaml format\nVous pouvez facilement extraire les traductions de vos templates avec la commande suivante :\nphp cecil.phar util:translations:extract --locale=&lt;code&gt; --show\nUtilisez --save à la place (ou en plus) de --show pour enregistrer les traductions dans un fichier. L'option --locale est obligatoire. Le format de sortie par défaut est yaml (utilisez --format=po pour le format gettext PO).\nPoedit est un éditeur de traduction simple et multiplateforme pour gettext (PO), et Poedit Pro prend en charge l'extraction de chaînes de traduction à partir de templates prêts à l'emploi.\nFaites attention au cache lorsque vous mettez à jour les fichiers de traduction.\nLe cache peut être vidé avec la commande suivante :\nphp cecil.phar cache:clear:translations`\nLocalisation de la date\nUtilise le filtre Twig format_date pour localiser une date dans les templates.\n{{ page.date|format_date('long') }}\n{# September 30, 2022 #}\nLes valeurs prises en charge sont : short, medium, long et full.\nSi vous souhaitez utiliser le filtre format_date avec des paramètres régionaux autres que \"en\", vous devez installer l'extension PHP internationale.",
      "content_html": "<h1>Localisation</h1>\n<p>Cecil prend en charge <a href=\"#traduction-de-texte\">traduction du texte</a> et <a href=\"#localisation-de-la-date\">localisation de la date</a>.</p>\n<h2 id=\"traduction-de-texte\">Traduction de texte</h2>\n<p>Utilise le <code translate=\"no\">trans</code> <em>tag</em> ou <em>filter</em> pour traduire des textes dans des templates.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">trans</span> with variables into locale %}</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endtrans</span> %}</span></code></pre>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ message|trans(variables = []) }}</span></code></pre>\n<h3 id=\"exemples\">Exemples</h3>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">trans</span> %}</span><span class=\"xml\">Hello World!</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endtrans</span> %}</span></code></pre>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ message|trans }}</span></code></pre>\n<p>Inclure des variables :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">trans</span> with {'%name%': 'Arnaud'} %}</span><span class=\"xml\">Hello %name%!</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endtrans</span> %}</span></code></pre>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ message|trans({'%name%': 'Arnaud'}) }}</span></code></pre>\n<p>Forcer les paramètres régionaux :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">trans</span> into 'fr_FR' %}</span><span class=\"xml\">Hello World!</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endtrans</span> %}</span></code></pre>\n<p>Pluraliser :</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">trans</span> with {'%count%': 42}%}</span><span class=\"xml\">{0}I don't have apples|{1}I have one apple|]1,Inf[I have %count% apples</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endtrans</span> %}</span></code></pre>\n<h2 id=\"fichiers-de-traduction\">Fichiers de traduction</h2>\n<p>Les fichiers de traduction doivent être nommés <code translate=\"no\">messages.&lt;locale&gt;.&lt;extension&gt;</code> et stockés dans le répertoire <a href=\"../configuration/7-layouts.fr.md\"><code translate=\"no\">translations</code></a>.\nLes extensions prises en charge sont définies pour chaque format de traduction dans <a href=\"../configuration/7-layouts.fr.md#layouts-translations\"><code translate=\"no\">layouts.translations.formats</code></a>.</p>\n<p>Le code locale (ex. : <code translate=\"no\">fr_FR</code>) d'une langue est défini dans les entrées <a href=\"../configuration/2-languages.fr.md#languages\"><code translate=\"no\">languages</code></a> de la configuration.</p>\n<p><em>Exemple:</em></p>\n<pre><code class=\"language-plaintext hljs plaintext\" translate=\"no\">&lt;mywebsite&gt;\n└─ translations\n   ├─ messages.fr_FR.mo   &lt;- Machine Object format\n   └─ messages.fr_FR.yaml &lt;- Yaml format</code></pre>\n<aside class=\"note note-info\"><p>Vous pouvez facilement extraire les traductions de vos templates avec la commande suivante :</p>\n<pre><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar util:translations:extract --locale=&lt;code&gt; --show</code></pre>\n<p>Utilisez <code translate=\"no\">--save</code> à la place (ou en plus) de <code translate=\"no\">--show</code> pour enregistrer les traductions dans un fichier. L'option <code translate=\"no\">--locale</code> est obligatoire. Le format de sortie par défaut est <code translate=\"no\">yaml</code> (utilisez <code translate=\"no\">--format=po</code> pour le format gettext PO).</p></aside>\n<aside class=\"note note-tip\"><p><a href=\"https://poedit.net\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Poedit</em></a> est un éditeur de traduction simple et multiplateforme pour gettext (PO), et <a href=\"https://poedit.net/pro\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Poedit Pro</em></a> prend en charge l'extraction de chaînes de traduction à partir de templates prêts à l'emploi.</p></aside>\n<aside class=\"note note-important\"><p>Faites attention au <a href=\"6-cache.fr.md\">cache</a> lorsque vous mettez à jour les fichiers de traduction.</p>\n<p>Le cache peut être vidé avec la commande suivante :</p>\n<pre><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar cache:clear:translations`</code></pre></aside>\n<h2 id=\"localisation-de-la-date\">Localisation de la date</h2>\n<p>Utilise le filtre Twig <a href=\"https://twig.symfony.com/doc/3.x/filters/format_date.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code translate=\"no\">format_date</code></a> pour localiser une date dans les templates.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-variable\">{{ page.<span class=\"hljs-name\">date</span>|format_date('long') }}</span><span class=\"xml\">\n</span><span class=\"hljs-comment\">{# September 30, 2022 #}</span></code></pre>\n<p>Les valeurs prises en charge sont : <code translate=\"no\">short</code>, <code translate=\"no\">medium</code>, <code translate=\"no\">long</code> et <code translate=\"no\">full</code>.</p>\n<aside class=\"note note-important\"><p>Si vous souhaitez utiliser le filtre <code translate=\"no\">format_date</code> <strong>avec des paramètres régionaux autres que \"en\"</strong>, vous devez <a href=\"https://php.net/intl.setup\" target=\"_blank\" rel=\"noopener noreferrer\">installer l'extension PHP internationale</a>.</p></aside>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/cache/",
      "url": "https://cecil.app/fr/documentation/templates/cache/",
      "title": "Cache",
      "summary": "Cache des templates et cache de fragments.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Cache\nCecil utilise un système de cache pour accélérer le processus de génération, il peut être désactivé ou effacé.\nIl existe trois types de cache dans le cas du rendu des templates : les templates eux-mêmes, assets et translations.\nVider le cache\nVous pouvez vider le cache avec les commandes suivantes :\nphp cecil.phar cache:clear               # clear all caches\nphp cecil.phar cache:clear:assets        # clear assets cache\nphp cecil.phar cache:clear:templates     # clear templates cache\nphp cecil.phar cache:clear:translations  # clear translations cache\nEn pratique, vous n'avez pas besoin de vider le cache manuellement, Cecil le fait pour vous en cas de besoin (par exemple lorsque des fichiers changent).\nFragments de cache\nCecil fournit un moyen de mettre en cache des parties du rendu des templates pour éviter de restituer plusieurs fois le même contenu partiel.\nPour utiliser les fragments de cache, vous devez envelopper le contenu que vous souhaitez mettre en cache avec la balise cache.\n{% cache 'unique-key' %}\n  {# cacheable content #}\n{% endcache %}\nVous devez utiliser la fonction cache_key pour être sûr d'avoir une clé de cache unique pour chaque contenu que vous souhaitez mettre en cache.\nLes fragments de cache sont persistants, donc si la clé de cache est trop générique, vous risquez de vous retrouver avec un mauvais contenu affiché.\nPour vider uniquement le cache des fragments, vous pouvez utiliser la commande suivante :\nphp cecil.phar cache:clear:templates --fragments\nDésactiver le cache\nVous pouvez désactiver le cache avec la configuration.\nLa désactivation du cache peut ralentir le processus de génération, ce n'est donc pas recommandé.\nLors du développement local, si vous devez vider le cache avant chaque génération, vous pouvez utiliser l'option suivante :\nphp cecil.phar serve --clear-cache          # clear all caches\nphp cecil.phar serve --clear-cache=&lt;regex&gt;  # clear cache for cache key matches with the regular expression &lt;regex&gt;\nExemple:\nphp cecil.phar serve --clear-cache=css  # clear cache for all CSS files",
      "content_html": "<h1>Cache</h1>\n<p>Cecil utilise un système de cache pour accélérer le processus de génération, il peut être désactivé ou effacé.</p>\n<p>Il existe trois types de cache dans le cas du rendu des templates : les templates eux-mêmes, <a href=\"../assets/index.fr.md#asset\">assets</a> et <a href=\"5-localization.fr.md#fichiers-de-traduction\">translations</a>.</p>\n<h2 id=\"vider-le-cache\">Vider le cache</h2>\n<p>Vous pouvez vider le cache avec les commandes suivantes :</p>\n<pre><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar cache:clear               <span class=\"hljs-comment\"># clear all caches</span>\nphp cecil.phar cache:clear:assets        <span class=\"hljs-comment\"># clear assets cache</span>\nphp cecil.phar cache:clear:templates     <span class=\"hljs-comment\"># clear templates cache</span>\nphp cecil.phar cache:clear:translations  <span class=\"hljs-comment\"># clear translations cache</span></code></pre>\n<aside class=\"note note-important\"><p>En pratique, vous n'avez pas besoin de vider le cache manuellement, Cecil le fait pour vous en cas de besoin (par exemple lorsque des fichiers changent).</p></aside>\n<h2 id=\"fragments-de-cache\">Fragments de cache</h2>\n<p>Cecil fournit un moyen de mettre en cache des parties du rendu des templates pour éviter de restituer plusieurs fois le même contenu partiel.</p>\n<p>Pour utiliser les <em>fragments</em> de cache, vous devez envelopper le contenu que vous souhaitez mettre en cache avec la balise <a href=\"https://twig.symfony.com/doc/tags/cache.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code translate=\"no\">cache</code></a>.</p>\n<pre><code class=\"language-twig hljs twig\" translate=\"no\"><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">cache</span> 'unique-key' %}</span><span class=\"xml\">\n  </span><span class=\"hljs-comment\">{# cacheable content #}</span><span class=\"xml\">\n</span><span class=\"hljs-template-tag\">{% <span class=\"hljs-name\">endcache</span> %}</span></code></pre>\n<aside class=\"note note-tip\"><p>Vous devez utiliser la fonction <a href=\"reference/1-functions.fr.md#cache-key\"><code translate=\"no\">cache_key</code></a> pour être sûr d'avoir une clé de cache unique pour chaque contenu que vous souhaitez mettre en cache.</p></aside>\n<aside class=\"note note-warning\"><p>Les <em>fragments</em> de cache sont persistants, donc si la clé de cache est trop générique, vous risquez de vous retrouver avec un mauvais contenu affiché.</p></aside>\n<p>Pour vider uniquement le cache des fragments, vous pouvez utiliser la commande suivante :</p>\n<pre><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar cache:clear:templates --fragments</code></pre>\n<h2 id=\"desactiver-le-cache\">Désactiver le cache</h2>\n<p>Vous pouvez désactiver le cache avec la <a href=\"../configuration/9-cache.fr.md\">configuration</a>.</p>\n<aside class=\"note note-warning\"><p>La désactivation du cache peut ralentir le processus de génération, ce n'est donc pas recommandé.</p>\n<p>Lors du développement local, si vous devez vider le cache avant chaque génération, vous pouvez utiliser l'option suivante :</p>\n<pre><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar serve --clear-cache          <span class=\"hljs-comment\"># clear all caches</span>\nphp cecil.phar serve --clear-cache=&lt;regex&gt;  <span class=\"hljs-comment\"># clear cache for cache key matches with the regular expression &lt;regex&gt;</span></code></pre>\n<p>Exemple:</p>\n<pre><code class=\"language-bash hljs bash\" translate=\"no\">php cecil.phar serve --clear-cache=css  <span class=\"hljs-comment\"># clear cache for all CSS files</span></code></pre></aside>",
      "language": "fr"
    },
    {
      "id": "https://cecil.app/fr/documentation/templates/etendre/",
      "url": "https://cecil.app/fr/documentation/templates/etendre/",
      "title": "Étendre",
      "summary": "Ajoutez des fonctions et filtres personnalisés, ou utilisez un thème.",
      "date_published": "2026-05-26T00:00:00+00:00",
      "date_modified": "2026-10-05T00:00:00+00:00","content_text": "Étendre\nFonctions et filtres\nVous pouvez ajouter des fonctions et des filtres personnalisés avec une extension Twig.\nThème\nC'est simple de construire un thème, il suffit de créer un dossier &lt;theme&gt; avec la structure suivante (comme un site web mais sans pages) :\n&lt;mywebsite&gt;\n└─ themes\n   └─ &lt;theme&gt;\n      ├─ config.yml\n      ├─ assets\n      ├─ layouts\n      ├─ static\n      └─ translations",
      "content_html": "<h1>Étendre</h1>\n<h2 id=\"fonctions-et-filtres\">Fonctions et filtres</h2>\n<p>Vous pouvez ajouter des <a href=\"reference/1-functions.fr.md\">fonctions</a> et des <a href=\"reference/3-filters.fr.md\">filtres</a> personnalisés avec une <a href=\"../developers/1-extend.fr.md#extension-twig\"><strong><em>extension Twig</em></strong></a>.</p>\n<h2 id=\"theme\">Thème</h2>\n<p>C'est simple de construire un thème, il suffit de créer un dossier <code translate=\"no\">&lt;theme&gt;</code> avec la structure suivante (comme un site web mais sans pages) :</p>\n<pre><code class=\"language-plaintext hljs plaintext\" translate=\"no\">&lt;mywebsite&gt;\n└─ themes\n   └─ &lt;theme&gt;\n      ├─ config.yml\n      ├─ assets\n      ├─ layouts\n      ├─ static\n      └─ translations</code></pre>",
      "language": "fr"
    }
  ]
}
