From c1c9d565184091bf422e05cbd6ca7b689cd1e1c1 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Sat, 12 Apr 2025 20:00:13 +0200 Subject: [PATCH] Move Opengraph metadata from the publication component to the publication page --- src/lib/components/Publication.svelte | 37 --------------------------- src/routes/publication/+page.svelte | 32 +++++++++++++++++++++++ 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/src/lib/components/Publication.svelte b/src/lib/components/Publication.svelte index 9d79264..e61cbb3 100644 --- a/src/lib/components/Publication.svelte +++ b/src/lib/components/Publication.svelte @@ -22,20 +22,6 @@ publicationType: string, indexEvent: NDKEvent }>(); - - // Get publication metadata for OpenGraph tags - let title = $derived($pharosInstance.getIndexTitle(rootId) || 'Alexandria Publication'); - let currentUrl = page.url.href; - - // Get image and summary from the event tags if available - // If image unavailable, use the Alexandria default pic. - let image = $derived(indexEvent?.getMatchingTags('image')[0]?.[1] || '/screenshots/old_books.jpg'); - let summary = $derived(indexEvent?.getMatchingTags('summary')[0]?.[1] || ``); - - // Debug: Log the event and its tags - console.log('indexEvent:', indexEvent); - console.log('image tag:', indexEvent?.getMatchingTags('image')); - console.log('summary tag:', indexEvent?.getMatchingTags('summary')); if (rootId !== $pharosInstance.getRootIndexId()) { console.error("Root ID does not match parser root index ID"); @@ -114,29 +100,6 @@ }); - - - {title} - - - - - - - - - {#if image} - - {/if} - - - - - - {#if image} - - {/if} - {#if showTocButton && !showToc}