your personal website on atproto - mirror blento.app
25
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix og images on custom domains

Florian 9ab035d3 31aa226b

+3 -11
+2 -6
src/lib/website/EditableWebsite.svelte
··· 18 18 import { AllCardDefinitions, CardDefinitionsByType } from '../cards'; 19 19 import { tick, type Component } from 'svelte'; 20 20 import type { CardDefinition, CreationModalComponentProps } from '../cards/types'; 21 - import { page } from '$app/state'; 21 + import { env } from '$env/dynamic/public'; 22 22 import { setIsCoarse, setIsMobile, setSelectedCardId, setSelectCard } from './context'; 23 23 import Context from './Context.svelte'; 24 24 import Head from './Head.svelte'; ··· 54 54 const sectionsEditingEnabled = $derived(isSectionsEditingEnabled(data.did)); 55 55 56 56 const ogImageUrl = $derived.by(() => { 57 - const origin = page.url.origin; 58 57 const v = data.updatedAt ? `?v=${data.updatedAt}` : ''; 59 - if (page.data.customDomain) return `${origin}/og-new.png${v}`; 60 - const handle = data.profile?.handle; 61 - const actor = handle && handle !== 'handle.invalid' ? handle : data.did; 62 - return `${origin}/${actor}/og-new.png${v}`; 58 + return `${env.PUBLIC_DOMAIN}/${data.did}/og-new.png${v}`; 63 59 }); 64 60 65 61 // Snapshot the original cards and sections so savePage can detect deletions.
+1 -5
src/lib/website/Website.svelte
··· 46 46 setHandleContext(data.handle as Handle); 47 47 48 48 const ogImageUrl = $derived.by(() => { 49 - const origin = page.url.origin; 50 49 const v = data.updatedAt ? `?v=${data.updatedAt}` : ''; 51 - if (page.data.customDomain) return `${origin}/og-new.png${v}`; 52 - const handle = data.profile?.handle; 53 - const actor = handle && handle !== 'handle.invalid' ? handle : data.did; 54 - return `${origin}/${actor}/og-new.png${v}`; 50 + return `${env.PUBLIC_DOMAIN}/${data.did}/og-new.png${v}`; 55 51 }); 56 52 57 53 let container: HTMLDivElement | undefined = $state();