From f24b79da2fe34acf73d482d7042c82199f998be0 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 11 Jul 2025 20:12:43 -0700 Subject: [PATCH] fix: improve album page functionality and design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix renderEdraContent to accept albumSlug option parameter - Fix album listing links from /photos/{slug} to /albums/{slug} - Remove album header section for cleaner photo story presentation - Remove broken photo page conditional that was preventing render - Pass album slug to content renderer for proper photo linking Creates more immersive experience where content speaks for itself. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/utils/content.ts | 2 +- src/routes/albums/+page.svelte | 2 +- src/routes/albums/[slug]/+page.svelte | 101 +------------------------- 3 files changed, 3 insertions(+), 102 deletions(-) diff --git a/src/lib/utils/content.ts b/src/lib/utils/content.ts index beebd87..a99024b 100644 --- a/src/lib/utils/content.ts +++ b/src/lib/utils/content.ts @@ -1,5 +1,5 @@ // Render Edra/BlockNote JSON content to HTML -export const renderEdraContent = (content: any): string => { +export const renderEdraContent = (content: any, options: { albumSlug?: string } = {}): string => { if (!content) return '' // Handle Tiptap format first (has type: 'doc') diff --git a/src/routes/albums/+page.svelte b/src/routes/albums/+page.svelte index e27f9ea..a173eec 100644 --- a/src/routes/albums/+page.svelte +++ b/src/routes/albums/+page.svelte @@ -149,7 +149,7 @@ {:else}
{#each allAlbums as album} - + {#if album.coverPhoto}
- {#snippet header()} -
-

{album.title}

- - {#if album.description} -

{album.description}

- {/if} - -
- {#if album.date} - 📅 {formatDate(album.date)} - {/if} - {#if album.location} - 📍 {album.location} - {/if} - 📷 {album.photos?.length || 0} photo{(album.photos?.length || 0) !== 1 - ? 's' - : ''} -
-
- {/snippet} - {#if album.content}
- {@html renderEdraContent(album.content)} + {@html renderEdraContent(album.content, { albumSlug: album.slug })}
{:else} @@ -199,34 +175,6 @@ {/if}
-{:else if type === 'photo' && photo} -
- -
- -
- -
- {photo.title -
- -
- {#if photo.title} -

{photo.title}

- {/if} - - {#if photo.caption || photo.description} -

{photo.caption || photo.description}

- {/if} - - {#if photo.exifData} -
- -
- {/if} -
-
-
{/if}