diff --git a/site/blueprints/site.yml b/site/blueprints/site.yml index 60c320c..f5a74b9 100644 --- a/site/blueprints/site.yml +++ b/site/blueprints/site.yml @@ -27,10 +27,12 @@ columns: label: Description type: textarea translate: true - logo: + footerLogo: label: Logo type: files + layout: cards max: 1 + help: Utilisé en pied de page (page À propos, Blog et Article). - width: 1/2 fields: diff --git a/site/controllers/site.php b/site/controllers/site.php index b016045..0468202 100644 --- a/site/controllers/site.php +++ b/site/controllers/site.php @@ -16,7 +16,7 @@ return function ($page, $kirby, $site) { 'site' => [ 'title' => $site->siteTitle()->value(), 'url' => $site->url(), - 'logo' => $site->logo()->toFile()?->url(), + 'logo' => $site->footerLogo()->toFile()?->url(), 'language' => $kirby->language()?->code() ?? 'fr', 'languages' => $kirby->languages()->map(function($l) { return [ diff --git a/src/components/layout/Footer.svelte b/src/components/layout/Footer.svelte index 1858b61..767047e 100644 --- a/src/components/layout/Footer.svelte +++ b/src/components/layout/Footer.svelte @@ -79,7 +79,7 @@ {/if} - @@ -126,6 +126,7 @@ :global(.blog .page-scrollable-footer) { margin-left: -12.4vw; + margin-top: 5rem; } /* --- Main row --- */ @@ -139,8 +140,7 @@ /* --- Brand --- */ .footer-brand img { - height: 40px; - width: auto; + width: 60px; } /* --- Info columns --- */ @@ -149,6 +149,7 @@ flex-direction: column; gap: 16px; width: 136px; + text-align: left; } .footer-col h3 { diff --git a/src/components/ui/LanguageSwitcher.svelte b/src/components/ui/LanguageSwitcher.svelte index 54e643d..9fbcacf 100644 --- a/src/components/ui/LanguageSwitcher.svelte +++ b/src/components/ui/LanguageSwitcher.svelte @@ -16,15 +16,14 @@ diff --git a/src/i18n/index.js b/src/i18n/index.js index 7745238..21f2f6d 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -25,8 +25,8 @@ const dict = { contact: { fr: "Contactez-nous", en: "Contact" }, follow_us: { fr: "Suivez-nous", en: "Follow us" }, newsletter_heading: { - fr: "Inscrivez-vous à notre newsletter !", - en: "Subscribe to our newsletter!", + fr: "Abonnez-vous à nos newsletters !", + en: "Subscribe to our newsletters!", }, newsletter_placeholder: { fr: "Votre email", en: "Enter your email" }, newsletter_submit: { fr: "S'inscrire", en: "Subscribe" }, diff --git a/src/router/index.js b/src/router/index.js index cb54766..a066343 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,12 +5,12 @@ import { locale } from "@state/locale.svelte"; let siteInitialized = false; function normalizePath(path) { - const stripped = path.replace(/^\/en(\/|$)/, '$1') || '/'; - return stripped === '/' ? '/home' : stripped; + const stripped = path.replace(/^\/en(\/|$)/, "$1") || "/"; + return stripped === "/" ? "/home" : stripped; } function apiPrefix() { - return locale.current === 'en' ? '/en' : ''; + return locale.current === "en" ? "/en" : ""; } /** @@ -80,10 +80,15 @@ export function slideTo(path, { skipHistory = false } = {}) { path = normalizePath(path); if (!skipHistory) { - const historyPath = locale.current === 'en' - ? (path === '/home' ? '/en' : `/en${path}`) - : (path === '/home' ? '/' : path); - history.pushState({}, '', historyPath); + const historyPath = + locale.current === "en" + ? path === "/home" + ? "/en" + : `/en${path}` + : path === "/home" + ? "/" + : path; + history.pushState({}, "", historyPath); } const idx = findSlideIndex(path); @@ -102,18 +107,18 @@ export function slideTo(path, { skipHistory = false } = {}) { export async function initRouter() { // Language detection: URL prefix > localStorage > navigator - const hasEnPrefix = window.location.pathname.startsWith('/en'); + const hasEnPrefix = window.location.pathname.startsWith("/en"); if (hasEnPrefix) { - locale.setLanguage('en'); - localStorage.setItem('wg_lang', 'en'); - } else if (!localStorage.getItem('wg_lang')) { - const navLang = navigator.language || navigator.languages?.[0] || 'fr'; - if (navLang.startsWith('en')) { - window.location.replace('/en' + window.location.pathname); + locale.setLanguage("en"); + localStorage.setItem("wg_lang", "en"); + } else if (!localStorage.getItem("wg_lang")) { + const navLang = navigator.language || navigator.languages?.[0] || "fr"; + if (navLang.startsWith("en")) { + window.location.replace("/en" + window.location.pathname); return; } - } else if (localStorage.getItem('wg_lang') === 'en') { - window.location.replace('/en' + window.location.pathname); + } else if (localStorage.getItem("wg_lang") === "en") { + window.location.replace("/en" + window.location.pathname); return; } @@ -126,9 +131,7 @@ export async function initRouter() { slides.setActiveIndex(idx); } - loadAllSlidesInBackground( - idx !== -1 ? slides.all[idx].path : initialPath - ); + loadAllSlidesInBackground(idx !== -1 ? slides.all[idx].path : initialPath); window.addEventListener("popstate", () => { const path = normalizePath(window.location.pathname); diff --git a/src/state/site.svelte.js b/src/state/site.svelte.js index 1aeaeaa..fef9327 100644 --- a/src/state/site.svelte.js +++ b/src/state/site.svelte.js @@ -1,27 +1,41 @@ -let title = $state('') -let url = $state('') -let language = $state('fr') -let languages = $state([]) -let logo = $state(null) -let navigation = $state([]) -let contact = $state({}) +let title = $state(""); +let url = $state(""); +let language = $state("fr"); +let languages = $state([]); +let logo = $state(null); +let navigation = $state([]); +let contact = $state({}); export const site = { - get title() { return title }, - get url() { return url }, - get language() { return language }, - get languages() { return languages }, - get logo() { return logo }, - get navigation() { return navigation }, - get contact() { return contact }, + get title() { + return title; + }, + get url() { + return url; + }, + get language() { + return language; + }, + get languages() { + return languages; + }, + get logo() { + return logo; + }, + get navigation() { + return navigation; + }, + get contact() { + return contact; + }, set: (data) => { - title = data.title || '' - url = data.url || '' - language = data.language || 'fr' - languages = data.languages || [] - logo = data.logo || null - navigation = data.navigation || [] - contact = data.contact || {} - } -} + title = data.title || ""; + url = data.url || ""; + language = data.language || "fr"; + languages = data.languages || []; + logo = data.logo || null; + navigation = data.navigation || []; + contact = data.contact || {}; + }, +};