From 33c9464dad0979b05323e4d508875ad47e1c425f Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 12 Sep 2024 22:57:55 +0000 Subject: Refactor Analytics and Head components --- src/components/Analytics.astro | 16 ++++++++++++++-- src/components/Head.astro | 10 +++++----- src/components/Pagination.astro | 4 ++-- src/layouts/BaseLayout.astro | 9 ++++++--- src/pages/[...page].astro | 6 +++--- src/pages/blog/[...slug].astro | 6 +++--- 6 files changed, 33 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/components/Analytics.astro b/src/components/Analytics.astro index 8c4303a..977c610 100644 --- a/src/components/Analytics.astro +++ b/src/components/Analytics.astro @@ -1,5 +1,17 @@ --- -const id = "T5X0z12SoASBV8Dv"; +type Props = { + readonly title: string; +}; + +const path = Astro.url.pathname; +const { title } = Astro.props; --- - + + + + + + diff --git a/src/components/Head.astro b/src/components/Head.astro index 7a575a9..9d7f39c 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -1,18 +1,18 @@ --- type Props = { - readonly description?: string; - readonly title?: string; + readonly description: string; + readonly title: string; }; const canonicalURL = new URL(Astro.url.pathname, Astro.site); -const { title, description } = Astro.props; +const { description, title } = Astro.props; --- - + @@ -20,5 +20,5 @@ const { title, description } = Astro.props; - {title ?? import.meta.env.DEFAULT_TITLE} + {title} diff --git a/src/components/Pagination.astro b/src/components/Pagination.astro index cc85db7..835ea2d 100644 --- a/src/components/Pagination.astro +++ b/src/components/Pagination.astro @@ -3,11 +3,11 @@ import Next from "./Pagination/Next.astro"; import Prev from "./Pagination/Prev.astro"; type Props = { - readonly prevUrl?: string; readonly nextUrl?: string; + readonly prevUrl?: string; }; -const { prevUrl, nextUrl } = Astro.props; +const { nextUrl, prevUrl } = Astro.props; --- - +

{post.data.title}

-- cgit v1.2.3