
์ธ์ด ๐ฐ๐ท ํ๊ตญ์ด
๋ฌธ์
์์ํ๊ธฐ
Add Comments to Your Svelte App
์ด๊ฒ์ FastComments์ ๊ณต์ Svelte ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค.
๋ผ์ด๋ธ ๋๊ธ, ์ฑํ ๋ฐ ๋ฆฌ๋ทฐ ์์ ฏ์ Svelte ์ฑ์ ์๋ฒ ๋ํ์ธ์.
์ ์ฅ์
๋ผ์ด๋ธ ๋ฐ๋ชจ 
๋ชจ๋ ์์ ฏ์ https://fastcomments.com/commenting-system-for-svelte์์ ์ง์ ์ฌ์ฉํด ๋ณด์ธ์.
FastComments์ฉ Svelte ์์ ฏ ๋ฐ ๋ํผ ๋ชจ์์
๋๋ค. src/routes์๋ ์คํ ๊ฐ๋ฅํ ์์ ๊ฐ ํฌํจ๋์ด ์์ต๋๋ค - ๋จ์ํ ๋ค์์ ์คํํ์ธ์:
npm install
npm run dev๊ทธ๋ฐ ๋ค์ ๋ชจ๋ ์์ ฏ์ ๋ณด๊ณ ์์ ํ ์ ์์ต๋๋ค - ์๋ฅผ ๋ค์ด ์์ ์ tenant id๋ฅผ ์ ๋ ฅํ๊ฑฐ๋ ๋ค๋ฅธ ๊ตฌ์ฑ์ ์๋ํด ๋ณผ ์ ์์ต๋๋ค.
TypeScript๊ฐ ์ฌ์ฉ๋์ด ๊ฐ ์์ ฏ์ config ๊ฐ์ฒด๋ฅผ ๊ฒ์ฌํ์ฌ ์ด๋ค ์ต์ ์ ์ฌ์ฉํ๋์ง ํ์ธํ ์ ์์ต๋๋ค.
๋น ๋ฅธ ์์ 
<script lang="ts">
import CommentWidget from "fastcomments-svelte/CommentWidget.svelte";
import type { FastCommentsCommentWidgetConfig } from "fastcomments-typescript";
let config: FastCommentsCommentWidgetConfig = {
tenantId: "demo",
urlId: "my-page"
};
</script>
<CommentWidget config={config} />
์์ ฏ 
์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์๋ ํ์ฌ ๋ค์ ์์ ฏ๋ค์ด ํฌํจ๋์ด ์์ต๋๋ค:
- ํ์ ์ฑํ
- ๋๊ธ ์ (๋จ์ผ)
- ๋๊ธ ์์ ฏ
- ์ด๋ฏธ์ง ์ฑํ
- ์คํธ๋ฆฌ๋ฐ ์ฑํ
- ์ฌ์ฉ์ ํ๋ ํผ๋
๋ํ ๋ค์ ์์ ๊ฐ ํฌํจ๋์ด ์์ต๋๋ค:
๊ฐ๋ฐ 
์์กด์ฑ์ npm install (๋๋ pnpm install ๋๋ yarn)๋ก ์ค์นํ ํ, ๊ฐ๋ฐ ์๋ฒ๋ฅผ ์์ํ์ธ์:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Everything inside src/lib is part of the library, everything inside src/routes is the showcase.
์ ์ง๋ณด์ ์ํ 
์ด ์ปดํฌ๋ํธ๋ค์ ๋น์ฌ์ ํต์ฌ VanillaJS ์ปดํฌ๋ํธ๋ค์ ๊ฐ์ธ๋ ๋ํผ์ ๋๋ค. ์ด๋ฌํ ์ปดํฌ๋ํธ๋ค์ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ฐฐํฌํ์ง ์๊ณ ๋ ์๋์ผ๋ก ์ ๋ฐ์ดํธ(๋ฒ๊ทธ ์์ , ๊ธฐ๋ฅ ์ถ๊ฐ)ํ ์ ์์ผ๋ฏ๋ก, ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ๋น๋ถ๊ฐ ๊ณต๊ฐ๋์ง ์๋๋ผ๋ FastComments๊ฐ ํ๋ฐํ ๊ฐ๋ฐ๋๊ณ ์์ง ์๋ค๋ ๋ป์ ์๋๋๋ค! ์ ๋ฐ์ดํธ๋ ์ฐ๋ฆฌ ๋ธ๋ก๊ทธ์์ ํ์ธํ์ธ์. ํธํ์ฑ์ ๊นจ๋ API ๋ณ๊ฒฝ์ด๋ ๊ธฐ๋ฅ์ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ฒ์ ์ด ์ฌ๋ ค์ง์ง ์๋ ํ ๊ธฐ๋ฐ ์ฝ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ ๋ ๋ฐ์๋์ง ์์ต๋๋ค.
๋์์ด ํ์ํ์ ๊ฐ์?
Svelte ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ ์ค ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ฑฐ๋ ์ง๋ฌธ์ด ์์ผ์๋ฉด, ๋ค์์ ์ด์ฉํด ์ฃผ์ธ์:
๊ธฐ์ฌ
๊ธฐ์ฌ๋ ํ์ํฉ๋๋ค! ๊ธฐ์ฌ ์ง์นจ์ GitHub ์ ์ฅ์๋ฅผ ๋ฐฉ๋ฌธํด ์ฃผ์ธ์.