From 25dcd4dd378df4077867bc6a783f8e4cc993e9df Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 4 Oct 2023 01:09:39 +0100 Subject: [PATCH] chore: add name to page titles --- src/layouts/Layout.astro | 4 +++- src/layouts/PageLayout.astro | 4 ++-- src/pages/index.mdx | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 31a1d7032..f0b7569ce 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -5,6 +5,7 @@ import Banner from "../components/Banner.astro"; import Navbar from "../components/Navbar.astro"; export interface Props { + isFront: boolean; title: string; } @@ -39,6 +40,7 @@ const footerLinks = [ ]; const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString().replace(/\/$/, ""); +const isFrontPage = Astro.props.isFront; --- @@ -54,7 +56,7 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString().replace( rel="stylesheet" /> - {title} + {isFrontPage ? title : `${title} | Oliver Davies`}