diff --git a/site/blueprints/site.yml b/site/blueprints/site.yml index f5a74b9..60c320c 100644 --- a/site/blueprints/site.yml +++ b/site/blueprints/site.yml @@ -27,12 +27,10 @@ columns: label: Description type: textarea translate: true - footerLogo: + logo: 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 0468202..b016045 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->footerLogo()->toFile()?->url(), + 'logo' => $site->logo()->toFile()?->url(), 'language' => $kirby->language()?->code() ?? 'fr', 'languages' => $kirby->languages()->map(function($l) { return [ diff --git a/site/snippets/header.php b/site/snippets/header.php index 7af780d..bb8f047 100644 --- a/site/snippets/header.php +++ b/site/snippets/header.php @@ -4,7 +4,7 @@ - <?= $site->title() ?> - <?= $page->title() ?> + <?= $page->meta_title()->or($page->title() . ' - ' . $site->site_title()) ?> diff --git a/src/components/layout/Footer.svelte b/src/components/layout/Footer.svelte index 767047e..1858b61 100644 --- a/src/components/layout/Footer.svelte +++ b/src/components/layout/Footer.svelte @@ -79,7 +79,7 @@ {/if} - + @@ -126,7 +126,6 @@ :global(.blog .page-scrollable-footer) { margin-left: -12.4vw; - margin-top: 5rem; } /* --- Main row --- */ @@ -140,7 +139,8 @@ /* --- Brand --- */ .footer-brand img { - width: 60px; + height: 40px; + width: auto; } /* --- Info columns --- */ @@ -149,7 +149,6 @@ 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 9fbcacf..54e643d 100644 --- a/src/components/ui/LanguageSwitcher.svelte +++ b/src/components/ui/LanguageSwitcher.svelte @@ -16,14 +16,15 @@ diff --git a/src/i18n/index.js b/src/i18n/index.js index 21f2f6d..7745238 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: "Abonnez-vous à nos newsletters !", - en: "Subscribe to our newsletters!", + fr: "Inscrivez-vous à notre newsletter !", + en: "Subscribe to our newsletter!", }, 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 bf9d275..cb54766 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,22 +80,17 @@ 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); const slidePath = idx !== -1 ? slides.all[idx].path : path; if (idx !== -1 && slides.all[idx].title) { - document.title = `World Game - ${slides.all[idx].title}`; + document.title = `${slides.all[idx].title} — World Game`; } slides.slideTo(slidePath); @@ -107,18 +102,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; } @@ -131,7 +126,9 @@ 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 fef9327..1aeaeaa 100644 --- a/src/state/site.svelte.js +++ b/src/state/site.svelte.js @@ -1,41 +1,27 @@ -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 || {} + } +}