aboutsummaryrefslogtreecommitdiff
path: root/src/layouts
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-06-28 20:31:02 -0400
committerAndrew Lee <alee14498@protonmail.com>2024-06-28 20:31:02 -0400
commit64cd7fc83d43a0ad7db1b51214291736bd245b44 (patch)
treeda8f9e47d50583932e144fa6b21585d5dd70bd21 /src/layouts
parent8edeebb44d9b3636268d95c30d462593d9a074d8 (diff)
downloadpersonal-website-64cd7fc83d43a0ad7db1b51214291736bd245b44.tar.gz
personal-website-64cd7fc83d43a0ad7db1b51214291736bd245b44.tar.bz2
personal-website-64cd7fc83d43a0ad7db1b51214291736bd245b44.zip
Guestbook overhaul; Comments; New post; Updated packages
Diffstat (limited to 'src/layouts')
-rw-r--r--src/layouts/BlogPost.astro16
-rw-r--r--src/layouts/Default.astro11
2 files changed, 26 insertions, 1 deletions
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;
+
---
<Layout title=`${title} - Andrew Lee` description={description}>
@@ -17,6 +27,12 @@ const { title, description, pubDate, tags } = Astro.props;
<main>
<slot />
</main>
+ {
+ disableComments ? null :
+ <h1>Comments</h1>
+ <BlogComments client:visible slug={slug} />
+ }
+
</div>
</Layout>
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();
<div transition:name="main" transition:animate="fade">
<slot />
<footer>
- <p>Made with {Astro.generator} and Hosted on Vercel</p>
+ <p class="small">Made with {Astro.generator} and Hosted on Vercel</p>
<p>Copyright &copy; {date.getFullYear()} Andrew Lee. <a href="https://github.com/Alee14/personal-website" target="_blank">View source code.</a></p>
</footer>
</div>
@@ -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;
}