Skip to content

Commit da297fb

Browse files
committed
add github discussions
1 parent 9f55e38 commit da297fb

File tree

7 files changed

+429
-7
lines changed

7 files changed

+429
-7
lines changed

astro.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import remarkToc from "remark-toc";
44
import remarkCollapse from "remark-collapse";
55
import remarkMath from "remark-math";
66
import rehypeKatex from "rehype-katex";
7+
import react from '@astrojs/react';
78

89
// https://astro.build/config
910
export default defineConfig({
@@ -23,4 +24,5 @@ export default defineConfig({
2324
},
2425
},
2526
},
27+
integrations: [react()],
2628
});

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@
1111
"format": "prettier . --write"
1212
},
1313
"dependencies": {
14+
"@astrojs/react": "^4.4.2",
1415
"@fontsource/inter": "^5.2.5",
16+
"@giscus/react": "^3.1.0",
1517
"@tailwindcss/vite": "^4.1.11",
18+
"@types/react-dom": "^19.2.3",
1619
"astro": "5.14.3",
1720
"photoswipe": "^5.4.4",
21+
"react": "^19.2.4",
22+
"react-dom": "^19.2.4",
1823
"rehype-katex": "^7.0.1",
1924
"remark-collapse": "^0.1.2",
2025
"remark-math": "^6.0.0",
@@ -24,6 +29,7 @@
2429
},
2530
"devDependencies": {
2631
"@eslint/js": "^9.36.0",
32+
"@types/react": "^19.2.14",
2733
"globals": "^16.4.0",
2834
"prettier": "3.6.2",
2935
"prettier-plugin-astro": "0.14.1",

src/components/Comment.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Giscus from '@giscus/react'
2+
3+
const Comments = () => {
4+
return (
5+
<Giscus
6+
repo="livensmi1e/space"
7+
repoId="R_kgDONjwlNQ"
8+
categoryId="DIC_kwDONjwlNc4C2rAt"
9+
mapping="pathname"
10+
reactionsEnabled="1"
11+
emitMetadata="0"
12+
inputPosition="top"
13+
lang="en"
14+
loading="lazy"
15+
strict="0"
16+
/>
17+
)
18+
}
19+
20+
export default Comments

src/components/Hero.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<section class="hero">
22
<p class="hero__title">~ My memories, my journey ~</p>
33
<p class="hero__description">
4-
This is place where I put my thoughts on life and post photos of sky on, beside my <a href="https://placetohidee.blogspot.com" target="_blank">first blog</a>.
4+
This is place where I write tech posts and put photos on, beside my <a href="https://placetohidee.blogspot.com" target="_blank">first blog</a>.
55
</p>
66
<div class="hero__quote">
77
<p class="quote">

src/layouts/Post.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import BaseLayout from "./Base.astro";
33
import Markdown from "../components/Markdown.astro";
4+
import Comment from "../components/Comment.tsx";
45
56
const notes = {
67
"info": {
@@ -35,6 +36,7 @@ const { meta } = Astro.props;
3536
<Markdown>
3637
<slot />
3738
</Markdown>
39+
<Comment client:only="react"/>
3840
</div>
3941
</BaseLayout>
4042

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"extends": "astro/tsconfigs/strict",
33
"include": [".astro/types.d.ts", "**/*"],
4-
"exclude": ["dist"]
4+
"exclude": ["dist"],
5+
"compilerOptions": {
6+
"jsx": "react-jsx",
7+
"jsxImportSource": "react"
8+
}
59
}

0 commit comments

Comments
 (0)