diff options
Diffstat (limited to 'src/layouts')
| -rw-r--r-- | src/layouts/BlogPost.astro | 16 | ||||
| -rw-r--r-- | src/layouts/Default.astro | 11 |
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 © {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; } |
