From 4f12ebaa9acb8c685760b89c1bd831150f7b0b3a Mon Sep 17 00:00:00 2001 From: Kenzo Date: Thu, 18 Dec 2025 13:24:22 +0100 Subject: [PATCH] Refactor: Update banner sorting logic to prioritize relevance --- src/components/Banner.astro | 52 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/src/components/Banner.astro b/src/components/Banner.astro index 4125084..3923440 100644 --- a/src/components/Banner.astro +++ b/src/components/Banner.astro @@ -1,26 +1,36 @@ --- // src/components/Banner.astro import "../styles/components/Banner.css" - -const API_BASE = 'https://cms.gallus-pub.ch'; - -let banner = null; - -try { - const response = await fetch(`${API_BASE}/api/banners/active`); - if (response.ok) { - const data = await response.json(); - banner = data.banner; - } -} catch (error) { - console.error('Failed to fetch banner:', error); -} --- -{banner && ( - -)} + + +