From 4c41f0d44eafbe5c3ee43f620de26a61ab57e008 Mon Sep 17 00:00:00 2001 From: Graham Hall Date: Thu, 8 Dec 2022 09:31:10 -0500 Subject: [PATCH] page titles and favicon --- public/favicon.svg | 14 +------------- src/layouts/Layout.astro | 3 ++- src/pages/about.md | 2 +- src/pages/posts/[slug].astro | 2 +- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/public/favicon.svg b/public/favicon.svg index 0f39062..065fb66 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1,13 +1 @@ - - - - - - - - - - - + \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6bf4d19..4e73c03 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -8,7 +8,8 @@ export interface Props { title: string; } -const { title } = Astro.props; +const title = Astro.props.frontmatter ? Astro.props.frontmatter.title : Astro.props.title; + --- diff --git a/src/pages/about.md b/src/pages/about.md index d1f1e41..35429d7 100644 --- a/src/pages/about.md +++ b/src/pages/about.md @@ -1,5 +1,5 @@ --- -layout: '../layouts/Layout.astro' +layout: ../layouts/Layout.astro title: 'About' --- diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro index 56b1963..b015cbe 100644 --- a/src/pages/posts/[slug].astro +++ b/src/pages/posts/[slug].astro @@ -12,7 +12,7 @@ const posts = await response.json(); const post = posts.objects[0]; --- - +

{post.title}