Merge pull request 'Use the Site design logo as the favicon (site and admin)' (#11) from logo-favicon into main

Reviewed-on: #11
This commit is contained in:
reudy 2026-10-26 14:20:06 +01:00
commit 4b50067a4a
4 changed files with 27 additions and 3 deletions

View file

@ -13,9 +13,13 @@
import Footer from '$lib/components/Footer.svelte';
import { createBasketStore, setBasketContext } from '$lib/basket.svelte';
import { rootStyleTag, siteThemeVars } from '$shared/theme';
import { thumbUrl } from '$shared/pb';
let { children, data } = $props();
// The logo from Site design is the tab icon (a 300×300 thumbnail, not the full upload).
let icon = $derived(data.header?.logo?.url ? thumbUrl(data.header.logo.url) : favicon);
// One basket store per public layout instance — provided to all children
// (Header indicator, ShopBlock, CheckoutBlock). Never module-level state.
const basketStore = createBasketStore(data.basket ?? null);
@ -27,7 +31,9 @@
</script>
<svelte:head>
<link rel="icon" href={favicon} />
<link rel="icon" href={icon} />
<!-- Home-screen icon on phones; iOS ignores SVG, so only for an uploaded logo. -->
{#if icon !== favicon}<link rel="apple-touch-icon" href={icon} />{/if}
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Site colours, rendered server-side (previously applied in onMount, which
flashed the defaults on every page load). Values are sanitised. -->