Skip to content

Commit 8185454

Browse files
committed
feat(disqus-comment): add Disqus comment to post page
1 parent 11ceb7a commit 8185454

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/pages/[slug].astro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
import { CollectionEntry, getCollection } from 'astro:content'
33
4+
import Disqus from '@/components/Disqus.astro'
45
import PostLayout from '@/layouts/PostLayout.astro'
6+
import { getPluginConfig, isPluginEnabled } from '@/utils/plugin'
57
68
export async function getStaticPaths() {
79
const allPosts = await getCollection('leetcode-solutions')
@@ -23,4 +25,14 @@ const { Content } = await entry.render()
2325

2426
<PostLayout frontmatter={entry.data}>
2527
<Content />
28+
{
29+
isPluginEnabled('disqus') && (
30+
<Disqus
31+
slot="post-footer"
32+
{...getPluginConfig('disqus')}
33+
pageURL={Astro.url.href}
34+
pageIdentifier={Astro.url.pathname}
35+
/>
36+
)
37+
}
2638
</PostLayout>

0 commit comments

Comments
 (0)