From de1885fe8fe279c95c2c2b101fad916958dadd4a Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 12 Sep 2024 22:10:31 +0000 Subject: Added Pagination component --- src/components/Pagination.astro | 46 ++++++++++++++++++++++++++++++++++++ src/components/PostElement.astro | 51 ---------------------------------------- src/components/PostSummary.astro | 51 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 51 deletions(-) create mode 100644 src/components/Pagination.astro delete mode 100644 src/components/PostElement.astro create mode 100644 src/components/PostSummary.astro (limited to 'src/components') diff --git a/src/components/Pagination.astro b/src/components/Pagination.astro new file mode 100644 index 0000000..e9fbc69 --- /dev/null +++ b/src/components/Pagination.astro @@ -0,0 +1,46 @@ +--- +type Props = { + readonly prevUrl?: string; + readonly nextUrl?: string; +}; + +const { prevUrl, nextUrl } = Astro.props; +--- + + + + diff --git a/src/components/PostElement.astro b/src/components/PostElement.astro deleted file mode 100644 index 2f98130..0000000 --- a/src/components/PostElement.astro +++ /dev/null @@ -1,51 +0,0 @@ ---- -import { type CollectionEntry } from "astro:content"; -import dayjs from "dayjs"; - -type Props = { - readonly post: CollectionEntry<"blog">; -}; - -const { post } = Astro.props; ---- - - - -
-

{post.data.title}

-
- - -
-

{post.data.description}

- Read More -
diff --git a/src/components/PostSummary.astro b/src/components/PostSummary.astro new file mode 100644 index 0000000..2f98130 --- /dev/null +++ b/src/components/PostSummary.astro @@ -0,0 +1,51 @@ +--- +import { type CollectionEntry } from "astro:content"; +import dayjs from "dayjs"; + +type Props = { + readonly post: CollectionEntry<"blog">; +}; + +const { post } = Astro.props; +--- + + + +
+

{post.data.title}

+
+ + +
+

{post.data.description}

+ Read More +
-- cgit v1.2.3