diff --git a/src/globals.d.ts b/src/globals.d.ts index b553086..b1897ac 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -5,7 +5,7 @@ interface BlogDocument { primaryTags: string[]; secondaryTags: string[]; blurb: string; - image?: string; + image: { src: string; alt: string; caption: string }; description: string; slug; } @@ -24,5 +24,6 @@ type PostMeta = { cover: { src: string; alt: string; + caption: string; }; }; diff --git a/src/lib/components/Blog/Article.svelte b/src/lib/components/Blog/Article.svelte index 8ca00f7..ba3ee6a 100644 --- a/src/lib/components/Blog/Article.svelte +++ b/src/lib/components/Blog/Article.svelte @@ -23,6 +23,10 @@ reverseDateAndRest /> +
+ {doc.image.alt} +
{doc.image.caption}
+
diff --git a/src/routes/blog/[...slug]/+page.svelte b/src/routes/blog/[...slug]/+page.svelte index c4ec26e..3914641 100644 --- a/src/routes/blog/[...slug]/+page.svelte +++ b/src/routes/blog/[...slug]/+page.svelte @@ -19,7 +19,8 @@ content: data.content, blurb: data.metadata.manifest.blurb, description: data.metadata.manifest.description, - slug: data.slug + slug: data.slug, + image: data.metadata.cover }; // $: doc = data.metadata; // $: componentSource = data.metadata.source?.replace('default', $config.style ?? 'default');