aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/PostPagination.astro47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/components/PostPagination.astro b/src/components/PostPagination.astro
new file mode 100644
index 0000000..6ae6bef
--- /dev/null
+++ b/src/components/PostPagination.astro
@@ -0,0 +1,47 @@
+---
+const { prevPost, nextPost } = Astro.props;
+---
+
+<style lang="scss">
+ .pagination {
+ overflow: hidden;
+ padding: 5rem 0;
+ width: 100%;
+ }
+
+ @media (width <=684px) {
+ .pagination {
+ padding: 2rem 0;
+ }
+ }
+
+ .prev,
+ .next {
+ max-width: 40%;
+ }
+
+ .prev {
+ float: left;
+ }
+
+ .next {
+ float: right;
+ }
+</style>
+
+<div class="pagination">
+ {
+ prevPost && (
+ <span class="prev">
+ <a href={`/blog/${prevPost.slug}`}>&lt; {prevPost.data.title}</a>
+ </span>
+ )
+ }
+ {
+ nextPost && (
+ <span class="next">
+ <a href={`/blog/${nextPost.slug}`}>{nextPost.data.title} &gt;</a>
+ </span>
+ )
+ }
+</div>