diff --git a/eleventy.config.js b/eleventy.config.js index 180fcc8..7df2a2d 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -1,3 +1,5 @@ +const cdn = require("./src/_data/cdn.json"); + module.exports = function(eleventyConfig) { // Locale-aware content: `t` resolves to the content bundle for the page's locale (fr by default) eleventyConfig.addGlobalData("eleventyComputed", { @@ -5,6 +7,12 @@ module.exports = function(eleventyConfig) { t: (data) => data.i18n[data.locale || "fr"] }); + // Serve local images through the BunnyCDN pull zone; leaves external URLs untouched + eleventyConfig.addFilter("cdn", (path) => { + if (typeof path !== "string" || !path.startsWith("/")) return path; + return cdn.url + path; + }); + // Copy assets folders to output eleventyConfig.addPassthroughCopy("src/assets"); diff --git a/src/_data/cdn.json b/src/_data/cdn.json new file mode 100644 index 0000000..08cc737 --- /dev/null +++ b/src/_data/cdn.json @@ -0,0 +1,3 @@ +{ + "url": "https://organisationka.b-cdn.net" +} diff --git a/src/_includes/layouts/base.njk b/src/_includes/layouts/base.njk index c96723b..321a32b 100644 --- a/src/_includes/layouts/base.njk +++ b/src/_includes/layouts/base.njk @@ -23,7 +23,7 @@ - + @@ -35,13 +35,13 @@ - + - - - + + + @@ -59,7 +59,7 @@ "name": "{{ t.site.name }}", "alternateName": "{{ t.site.shortName }}", "url": "https://o-k-i.net", - "logo": "https://o-k-i.net/assets/images/logo-512x512.png", + "logo": "{{ '/assets/images/logo-512x512.png' | cdn }}", "description": "{{ t.site.description }}", "address": { "@type": "PostalAddress", diff --git a/src/_includes/partials/djangokam.njk b/src/_includes/partials/djangokam.njk index 2ada436..4bd5718 100644 --- a/src/_includes/partials/djangokam.njk +++ b/src/_includes/partials/djangokam.njk @@ -4,7 +4,7 @@

{{ t.djangokam.titre }} {{ t.djangokam.titreAccent }}

{{ t.djangokam.accroche }}

- Portrait officiel de DJANGOKAM + Portrait officiel de DJANGOKAM
{{ t.djangokam.message_cle }} @@ -19,7 +19,7 @@
- {{ t.djangokam.duo.alt }} + {{ t.djangokam.duo.alt }}
{{ t.djangokam.duo.legende }}
@@ -39,7 +39,7 @@ {% for clip in t.djangokam.clips %}
- {{ clip.alt }} + {{ clip.alt }}
{{ clip.titre }}
diff --git a/src/_includes/partials/nav.njk b/src/_includes/partials/nav.njk index 8cc7a06..0c6aa1d 100644 --- a/src/_includes/partials/nav.njk +++ b/src/_includes/partials/nav.njk @@ -1,7 +1,7 @@