diff --git a/src/hooks.server.ts b/src/hooks.server.ts index e69ad50..7978fed 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -23,14 +23,11 @@ export const handle: Handle = async ({ event, resolve }) => { if (!event.url.pathname.includes('/assets')) { log({ response: response, event: event, status: response.status }) } - // console.timeEnd(`id: ${id}`) return response } export const handleError = async ({ event, status, message }) => { - // const errorId = crypto.randomUUID() log({ status: status, event: event, content: message }) - return { message: status === 404 ? `This page does not exist!` : 'Whoops!' // errorId diff --git a/src/routes/[slug]/+layout.server.ts b/src/routes/[slug]/+layout.server.ts index 3f88102..def1f6f 100644 --- a/src/routes/[slug]/+layout.server.ts +++ b/src/routes/[slug]/+layout.server.ts @@ -19,7 +19,7 @@ export const load: LayoutServerLoad = async ({ locals, params, cookies }) => { 'icon', 'topics', { cards: [{ cards_id: ['*', { media: [{ directus_files_id: ['*'] }] }] }] }, - { topics: [{ cards: [{ cards_id: ['*'] }] }, 'title', 'slug'] } + { topics: [{ cards: [{ cards_id: ['*'] }] }, 'title', 'slug', 'icon'] } ], deep: { cards: { diff --git a/src/routes/[slug]/+page.svelte b/src/routes/[slug]/+page.svelte index 7b78e0e..a9f2ffd 100644 --- a/src/routes/[slug]/+page.svelte +++ b/src/routes/[slug]/+page.svelte @@ -46,25 +46,31 @@ goto(`/${$page.params.slug}/${topic.slug}`) }} > - + {#if topic.icon} +
+ {@html topic.icon} +
+ {:else} + + {/if}

{topic.title}