From 64cd7fc83d43a0ad7db1b51214291736bd245b44 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 28 Jun 2024 20:31:02 -0400 Subject: Guestbook overhaul; Comments; New post; Updated packages --- src/layouts/BlogPost.astro | 16 ++++++++++++++++ src/layouts/Default.astro | 11 ++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'src/layouts') diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro index 628215f..70562c6 100644 --- a/src/layouts/BlogPost.astro +++ b/src/layouts/BlogPost.astro @@ -1,6 +1,16 @@ --- import Layout from './Default.astro'; +import BlogComments from '../components/BlogComments.jsx'; +import "../styles/cards.css"; const { title, description, pubDate, tags } = Astro.props; +const { slug } = Astro.params; + +let disableComments; + +const response = await fetch(`${import.meta.env.PUBLIC_API_URL}/comments/${slug}/disabled`); +const data = await response.json(); +disableComments = data.postDisabled; + --- @@ -17,6 +27,12 @@ const { title, description, pubDate, tags } = Astro.props;
+ { + disableComments ? null : +

Comments

+ + } +
diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index 9c0d1c7..775c94c 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -43,7 +43,7 @@ const date = new Date();
@@ -74,10 +74,19 @@ const date = new Date(); } footer { + margin: 2em; text-align: center; font-size: 1.3em; } + footer p { + margin: 0.6em; + } + + .small { + font-size: 0.9em; + } + h1, h2, h3, h4, h5, h6 { font-weight: 500; } -- cgit v1.2.3