From 3376c53b2ee91041d5eaa0f9274da0affd7d4a9d Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 12 Sep 2024 16:36:57 +0000 Subject: Refactor Astro components and layouts --- src/components/Head.astro | 6 ++++- src/components/PostElement.astro | 5 ++++ src/components/PostPagination.astro | 47 ------------------------------------- 3 files changed, 10 insertions(+), 48 deletions(-) delete mode 100644 src/components/PostPagination.astro (limited to 'src/components') diff --git a/src/components/Head.astro b/src/components/Head.astro index 42ae32b..7a575a9 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -1,6 +1,10 @@ --- -const canonicalURL = new URL(Astro.url.pathname, Astro.site); +type Props = { + readonly description?: string; + readonly title?: string; +}; +const canonicalURL = new URL(Astro.url.pathname, Astro.site); const { title, description } = Astro.props; --- diff --git a/src/components/PostElement.astro b/src/components/PostElement.astro index 889cc47..2f98130 100644 --- a/src/components/PostElement.astro +++ b/src/components/PostElement.astro @@ -1,6 +1,11 @@ --- +import { type CollectionEntry } from "astro:content"; import dayjs from "dayjs"; +type Props = { + readonly post: CollectionEntry<"blog">; +}; + const { post } = Astro.props; --- diff --git a/src/components/PostPagination.astro b/src/components/PostPagination.astro deleted file mode 100644 index 6ae6bef..0000000 --- a/src/components/PostPagination.astro +++ /dev/null @@ -1,47 +0,0 @@ ---- -const { prevPost, nextPost } = Astro.props; ---- - - - - -- cgit v1.2.3