<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://cecil.app/fr/xsl/atom.xsl" media="all"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
  <id>https://cecil.app/fr/documentation/assets/</id>
  <title>Cecil - Assets</title>
  <subtitle><![CDATA[Cecil est une application PHP en ligne de commande qui fusionne des pages Markdown, des médias et des templates Twig afin de générer un site Web statique.]]></subtitle>
  <link href="https://cecil.app/fr/documentation/assets/atom.xml" rel="self" type="application/atom+xml" />
  <link href="https://cecil.app/fr/documentation/assets/" rel="alternate" type="text/html" />
  <updated>2026-10-06T00:33:59+00:00</updated>
  <author>
    <name>Cecil</name>
    <uri>https://cecil.app</uri>
  </author>
  <entry xml:lang="fr">
    <id>https://cecil.app/fr/documentation/assets/images/</id>
    <title>Images</title>
    <published>2026-05-26T00:00:00+00:00</published>
    <updated>2026-10-05T00:00:00+00:00</updated>
    <link href="https://cecil.app/fr/documentation/assets/images/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Images</h1>
<h2 id="image-srcset">image_srcset</h2>
<p>Construit l'attribut HTML img <code translate="no">srcset</code> (responsive) d'un élément d'image.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_srcset(asset) }}</span></code></pre>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> asset = asset(image_path) %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"asset"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_srcset(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">sizes</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_sizes('asset') }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span></code></pre>
<h2 id="image-sizes">image_sizes</h2>
<p>Renvoie l'attribut HTML img <code translate="no">sizes</code> basé sur un nom de classe CSS.
Il doit être utilisé conjointement avec la fonction <a href="/fr/documentation/assets/images/#image-srcset"><code translate="no">image_srcset</code></a>.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_sizes('class') }}</span></code></pre>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> asset = asset(image_path) %}</span><span class="xml">
<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset.height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"asset"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_srcset(asset) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">sizes</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ image_sizes('asset') }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span></span></code></pre>
<h2 id="image-from-website">image_from_website</h2>
<p>Construit l'élément HTML img à partir d'une URL de site Web en extrayant son image d'illustration.
Retourne <code translate="no">null</code> si aucune image n'est trouvée.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_from_website('url', {attributs}, {options}) }}</span></code></pre>
<p>L'image est recherchée dans le HTML de la page avec les fallbacks suivants, le premier candidat pouvant être téléchargé en tant qu'image est utilisé :</p>
<ol>
<li>Open Graph : <code translate="no">og:image:secure_url</code>, <code translate="no">og:image</code>, <code translate="no">og:image:url</code></li>
<li>Twitter : <code translate="no">twitter:image</code>, <code translate="no">twitter:image:src</code></li>
<li><code translate="no">&lt;link rel="image_src"&gt;</code></li>
<li>Microdata : <code translate="no">itemprop="image"</code></li>
<li>JSON-LD : propriété <code translate="no">image</code></li>
<li>Première <code translate="no">&lt;img&gt;</code> de <code translate="no">&lt;article&gt;</code>, <code translate="no">&lt;main&gt;</code> ou <code translate="no">&lt;body&gt;</code></li>
<li><code translate="no">&lt;link rel="apple-touch-icon"&gt;</code></li>
<li><code translate="no">&lt;link rel="icon"&gt;</code></li>
</ol>
<p>Les URL relatives sont résolues par rapport à <code translate="no">&lt;base href&gt;</code> ou à l'URL de la page.</p>
<p>L'URL de l'image trouvée et l'image téléchargée sont mises en cache (voir <a href="/fr/documentation/configuration/cache/"><code translate="no">cache.assets.remote.ttl</code></a>).</p>
<p>Options :</p>
<ul>
<li><code translate="no">fallback</code> : chemin (ou URL) de l'image utilisée si aucune image n'est trouvée</li>
<li>autres options de <a href="/fr/documentation/templates/reference/fonctions/#html"><code translate="no">image</code></a> (ex. : <code translate="no">responsive</code>, <code translate="no">formats</code>)</li>
</ul>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ image_from_website('https://example.com/page-with-image.html') }}</span><span class="xml">

</span><span class="hljs-comment">{# avec une image de fallback #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ image_from_website('https://example.com/', {alt: 'Illustration'}, {fallback: 'images/default.png'}) }}</span></code></pre>
<h2 id="resize">resize</h2>
<p>Redimensionne une image à une largeur (en pixels) ou/et une hauteur (en pixels) spécifiée.</p>
<ul>
<li>Si seule la largeur est spécifiée, la hauteur est calculée pour conserver le rapport hauteur/largeur</li>
<li>Si seule la hauteur est spécifiée, la largeur est calculée pour conserver le rapport hauteur/largeur</li>
<li>Si la largeur et la hauteur sont spécifiées, l'image est redimensionnée pour s'adapter aux dimensions données, l'image est recadrée et centrée si nécessaire</li>
<li>Si Remove_animation est vrai, toute animation dans l'image (par exemple, GIF) sera supprimée</li>
</ul>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|resize(width: width, height: height, remove_animation: bool) }}</span></code></pre>
<aside class="note note-info"><p>Le fichier original n'est pas modifié et la version redimensionnée est enregistrée sous <code translate="no">/thumbnails/&lt;width&gt;x&lt;height&gt;/image.jpg</code>.</p></aside>
<aside class="note note-tip"><p>Les fichiers ICO sont supportés : la plus grande icône est redimensionnée et enregistrée dans un fichier ICO à icône unique (compressée en PNG). Les icônes stockées en BMP avec une profondeur de couleur autre que 24 ou 32 bits nécessitent l'extension PHP <a href="https://www.php.net/manual/fr/book.imagick.php" target="_blank" rel="noopener noreferrer">Imagick</a> : à défaut, le fichier ICO original est conservé et un avertissement est journalisé.</p></aside>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(page.image)|resize(300) }}</span><span class="xml">
</span><span class="hljs-comment">{# equivalent to: #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(width: 300) }}</span><span class="xml">
</span><span class="hljs-comment">{# resizes to 300px width, height auto-calculated to preserve aspect ratio #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(height: 200) }}</span><span class="xml">
</span><span class="hljs-comment">{# resizes to 300px width and 200px height, and crops if necessary #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(300, 200) }}</span><span class="xml">
</span><span class="hljs-comment">{# removes any animation from the image #}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(page.image)|resize(width: 1200, height: 630, remove_animation: true) }}</span></code></pre>
<h2 id="cover">cover</h2>
<p>Redimensionne une image à une largeur et une hauteur spécifiées, en la recadrant si nécessaire.</p>
<aside class="note note-warning"><p>Le filtre <code translate="no">cover</code> est obsolète depuis la version <ins>8.77</ins> et sera supprimé dans les versions futures. Utilisez plutôt le filtre <a href="#resize"><code translate="no">resize</code></a>, avec les paramètres de largeur et de hauteur.</p></aside>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|cover(width, height) }}</span></code></pre>
<p><em>Exemple:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(page.image)|cover(1200, 630) }}</span></code></pre>
<h2 id="maskable">maskable</h2>
<p>Ajoute un remplissage, en pourcentages, à une image pour la rendre masquable.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|maskable(padding) }}</span></code></pre>
<p><em>Exemple:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('icon.png')|maskable }}</span></code></pre>
<h2 id="webp">webp</h2>
<p>Convertit une image au format <a href="https://developers.google.com/speed/webp" target="_blank" rel="noopener noreferrer">WebP</a>.</p>
<p><em>Exemple:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">picture</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">source</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/webp"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path)|webp }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset(image_path)) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">picture</span>&gt;</span></span></code></pre>
<h2 id="avif">avif</h2>
<p>Convertit une image au format <a href="https://github.com/AOMediaCodec/libavif" target="_blank" rel="noopener noreferrer">AVIF</a>.</p>
<p><em>Exemple:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">picture</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">source</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/avif"</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path)|avif }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ url(asset(image_path)) }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).width }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"</span></span></span><span class="hljs-template-variable">{{ asset(image_path).height }}</span><span class="xml"><span class="hljs-tag"><span class="hljs-string">"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">picture</span>&gt;</span></span></code></pre>
<h2 id="lqip">lqip</h2>
<p>Renvoie un <a href="https://www.guypo.com/introducing-lqip-low-quality-image-placeholders" target="_blank" rel="noopener noreferrer">espace réservé pour une image de faible qualité</a> (100 x 100 px, flou à 50 %) comme URL de données.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|lqip }}</span></code></pre>
<h2 id="dominant-color">dominant_color</h2>
<p>Renvoie la <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color" target="_blank" rel="noopener noreferrer">couleur hexadécimale</a> dominante d'une image.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(image_path)|dominant_color }}</span></code></pre>]]>
    </content>
  </entry>
  <entry xml:lang="fr">
    <id>https://cecil.app/fr/documentation/assets/traitements/</id>
    <title>CSS, JavaScript et traitements</title>
    <published>2026-05-26T00:00:00+00:00</published>
    <updated>2026-10-05T00:00:00+00:00</updated>
    <link href="https://cecil.app/fr/documentation/assets/traitements/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>CSS, JavaScript et traitements</h1>
<h2 id="fingerprint">fingerprint</h2>
<p>Ajoutez l'empreinte digitale du contenu du fichier au nom du fichier.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|fingerprint }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ path|fingerprint }}</span></code></pre>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|fingerprint }}</span></code></pre>
<h2 id="minify">minify</h2>
<p>Réduire un fichier CSS ou JavaScript.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|minify }}</span></code></pre>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|minify }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset('scripts.js')|minify }}</span></code></pre>
<h2 id="minify-css">minify_css</h2>
<p>Réduire une chaîne CSS.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|minify_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_css %}</span><span class="xml">
</span><span class="hljs-comment">{# CSS here #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span></code></pre>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> styles = 'some CSS here' %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ styles|minify_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_css %}</span><span class="xml"><span class="css">
  <span class="hljs-selector-tag">html</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fcfcfc</span>;
    <span class="hljs-attribute">color</span>: <span class="hljs-number">#444</span>;
  }
</span></span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span></span></code></pre>
<h2 id="minify-js">minify_js</h2>
<p>Réduire une chaîne JavaScript.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|minify_js }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_js %}</span><span class="xml">
</span><span class="hljs-comment">{# JavaScript here #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span></code></pre>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> script = 'some JavaScript here' %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ script|minify_js }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> minify_js %}</span><span class="xml"><span class="javascript">
  <span class="hljs-keyword">var</span> test = <span class="hljs-string">'test'</span>;
  <span class="hljs-built_in">console</span>.log(test);
</span></span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></span></code></pre>
<h2 id="scss-to-css">scss_to_css</h2>
<p>Compile une chaîne <a href="https://sass-lang.com" target="_blank" rel="noopener noreferrer">Sass</a> en CSS.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ variable|scss_to_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> scss_to_css %}</span><span class="xml">
</span><span class="hljs-comment">{# SCSS here #}</span><span class="xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span></code></pre>
<p>Alias : <code translate="no">sass_to_css</code>.</p>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">set</span></span> scss = 'some SCSS here' %}</span><span class="xml">
</span><span class="hljs-template-variable">{{ scss|scss_to_css }}</span></code></pre>
<pre><code class="language-twig hljs twig" translate="no"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span>
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">apply</span></span> scss_to_css %}</span><span class="xml">
  $color: #fcfcfc;
  div {
    color: lighten($color, 20%);
  }
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-keyword">endapply</span></span> %}</span><span class="xml">
<span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span></span></code></pre>
<h2 id="to-css">to_css</h2>
<p>Compile un fichier <a href="https://sass-lang.com" target="_blank" rel="noopener noreferrer">Sass</a> en CSS.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|to_css }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ path|to_css }}</span></code></pre>
<p><em>Exemples :</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.scss')|to_css }}</span></code></pre>
<h2 id="inline">inline</h2>
<p>Affiche le contenu d'un <em>Asset</em>.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|inline }}</span></code></pre>
<p><em>Exemple:</em></p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset('styles.css')|inline }}</span></code></pre>
<h2 id="dataurl">dataurl</h2>
<p>Renvoie l'<a href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs" target="_blank" rel="noopener noreferrer">URL de données</a> d'un actif.</p>
<pre><code class="language-twig hljs twig" translate="no"><span class="hljs-template-variable">{{ asset(path)|dataurl }}</span><span class="xml">
</span><span class="hljs-template-variable">{{ asset(image_path)|dataurl }}</span></code></pre>]]>
    </content>
  </entry>
  <entry xml:lang="fr">
    <id>https://cecil.app/fr/documentation/assets/fournisseurs-cdn/</id>
    <title>Fournisseurs de CDN</title>
    <published>2023-10-23T00:00:00+00:00</published>
    <updated>2026-10-02T00:00:00+00:00</updated>
    <link href="https://cecil.app/fr/documentation/assets/fournisseurs-cdn/" rel="alternate" type="text/html" />
    <content type="html">
      <![CDATA[<h1>Fournisseurs de CDN</h1>
<p>Exemples de configuration de fournisseurs de CDN pour les <a href="/fr/documentation/configuration/assets/#assets-images-cdn"><code translate="no">options de configuration</code></a>.</p>
<h2 id="cloudinary">Cloudinary</h2>
<p><a href="https://cloudinary.com" target="_blank" rel="noopener noreferrer">https://cloudinary.com</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://res.cloudinary.com/%account%/image/fetch/c_limit,w_%width%,q_%quality%,f_%format%,d_default/%image_url%'</span></code></pre>
<h2 id="cloudimage">Cloudimage</h2>
<p><a href="https://www.cloudimage.io" target="_blank" rel="noopener noreferrer">https://www.cloudimage.io</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://%account%.cloudimg.io/%image_url%?w=%width%&amp;q=%quality%&amp;force_format=%format%'</span></code></pre>
<h2 id="twicpics">TwicPics</h2>
<p><a href="https://www.twicpics.com" target="_blank" rel="noopener noreferrer">https://www.twicpics.com</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">remote:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://%account%.twic.pics/%image_url%?twic=v1/resize=%width%/quality=%quality%/output=%format%'</span></code></pre>
<p><code translate="no">Source URL</code> : URL de base de votre site.</p>
<h2 id="imgix">imgix</h2>
<p><a href="https://imgix.com" target="_blank" rel="noopener noreferrer">https://imgix.com</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">account:</span> <span class="hljs-string">'xxxx'</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">remote:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'https://%account%.imgix.net/%image_url%?w=%width%&amp;q=%quality%&amp;fm=%format%'</span></code></pre>
<p><code translate="no">Base URL</code> : URL de base de votre site.</p>
<h2 id="netlify-image-cdn">Netlify Image CDN</h2>
<p><a href="https://docs.netlify.com/image-cdn/overview/" target="_blank" rel="noopener noreferrer">https://docs.netlify.com/image-cdn/overview/</a></p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-attr">assets:</span>
  <span class="hljs-attr">images:</span>
    <span class="hljs-attr">cdn:</span>
      <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
      <span class="hljs-attr">canonical:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">url:</span> <span class="hljs-string">'/.netlify/images?url=%image_url%&amp;w=%width%&amp;fm=%format%'</span></code></pre>
<h3 id="execution-en-local">Exécution en local</h3>
<h4>Installer Netlify CLI</h4>
<pre><code class="language-bash hljs bash" translate="no">npm install netlify-cli -g
netlify link</code></pre>
<p><code translate="no">netlify.toml</code> :</p>
<pre><code class="language-yaml hljs yaml" translate="no"><span class="hljs-string">[dev]</span>
  <span class="hljs-string">targetPort</span> <span class="hljs-string">=</span> <span class="hljs-number">8000</span></code></pre>
<h4>Démarrer le serveur local</h4>
<pre><code class="language-bash hljs bash" translate="no">php cecil.phar serve &amp; netlify dev</code></pre>
<p>Ouvrez <a href="http://localhost:8888" target="_blank" rel="noopener noreferrer">http://localhost:8888</a></p>]]>
    </content>
  </entry>
</feed>
