Skip to content

Commit

Permalink
✨feat: add blog comments form
Browse files Browse the repository at this point in the history
  • Loading branch information
yanosea committed Mar 18, 2024
1 parent 6a67e98 commit a75d5e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions front/src/components/BlogComments.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script
is:inline
src="https://utteranc.es/client.js"
repo="yanosea/yanoPortfolioBlogComments"
issue-term="pathname"
theme="github-dark"
crossorigin="anonymous"
async></script>
7 changes: 7 additions & 0 deletions front/src/layouts/PageLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ import BaseLayout, {
type Props as BaseLayoutProps,
} from "@/layouts/BaseLayout.astro";
import BlogComments from "@/components/BlogComments.astro";
import Footer, { type Props as FooterProps } from "@/components/Footer.astro";
import Header from "@/components/Header.astro";
export interface Props extends BaseLayoutProps {}
export interface Props extends FooterProps {}
export interface Props {
blogComments?: boolean;
}
const { blogComments } = Astro.props;
---

<BaseLayout {...Astro.props}>
<Header />
<main class="max-w-screen-lg m-auto px-6 py-6 space-y-6">
<slot />
{blogComments && <BlogComments />}
</main>
<Footer {...Astro.props} />
</BaseLayout>
1 change: 1 addition & 0 deletions front/src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const { Content } = await entry.render();
description={entry.data.description}
article
ssg
blogComments
>
<article class="m-auto space-y-6">
<Title icon={entry.data.title_icon} title={entry.data.title} />
Expand Down

0 comments on commit a75d5e3

Please sign in to comment.