Post

๐Ÿฅœ [Jekyll] giscus ๋ฅผ ๋ธ”๋กœ๊ทธ์— ์ ์šฉํ•˜๊ธฐ

๋น„๊ต

์šฐ๋ฆฌ ๋„ํ† ๋ฆฌ ์ˆฒ ๋ธ”๋กœ๊ทธ์—๋„ ๋Œ“๊ธ€ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ์—ˆ๋‹ค.

์ข…๋ฅ˜๋Š” ์ƒ๊ฐ๋ณด๋‹ค ๋‹ค์–‘ํ–ˆ๋Š”๋ฐ,

utterances, disqus, giscus ์ด๋ ‡๊ฒŒ ์„ธ๊ฐ€์ง€๋ฅผ ์ž์ฃผ ์“ฐ๋Š” ๊ฒƒ ๊ฐ™์•˜๋‹ค.


ํ•˜์ง€๋งŒ ๊ทธ ๋•Œ๋ฌธ์— ๋˜ ๊ณ ๋ฏผ์— ๋น ์ง€๊ฒŒ ๋๋‹ค.

๋งŽ์€ ๊ณ ๋ฏผ ๋์— disqus, giscus ๋กœ ์ถ”๋ ธ๋‹ค. ์ด ๋‘˜์€ github ๊ธฐ๋ฐ˜์œผ๋กœ ์ž‘๋™ํ•œ๋‹ค๊ณ  ํ•˜๊ธฐ ๋•Œ๋ฌธ


ํ•˜์ง€๋งŒ

disqus ๋Š” issue ๊ธฐ๋ฐ˜์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ณ 

giscus ๋Š” discussion ์„ ์‚ฌ์šฉํ•œ๋‹ค๋Š” ๋ง์„ ๋“ฃ๊ณ 

๋Œ“๊ธ€์ด issue ์™€๋Š” ๋งž์ง€ ์•Š๋Š”๋‹ค ํŒ๋‹จํ•˜์—ฌ giscus ๋ฅผ ์„ ํƒํ–ˆ๋‹ค.


์ ์šฉ๋ฐฉ๋ฒ•

1. giscus ์„ค์น˜

image-01 (๋‚ด๊ฐ€ ์‚ฌ์šฉํ•  repo ์— giscus ๋ฅผ ์„ค์น˜๋ฅผ ํ•œ๋‹ค)


2. Repo ๋‚ด discussion ์ƒ์„ฑ

image-02 (Repo > Setting > ํ•˜๋‹จ > discussion Click)


3. Repo > Discussions

image-03 (new discussion ์„ ํด๋ฆญํ•œ๋‹ค.)

image-04 (์ƒˆ๋กœ์šด ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์ƒ์„ฑ)

image-05 (Comments ๋ผ๊ณ  ์ž‘์„ฑ ํ›„ Announcement ๋กœ ์„ค์ • ํ›„ ์ €์žฅ)


4. giscus ์„ค์ •ํ•˜๊ธฐ

๋จผ์ € giscus ์•ฑ ๋ฌธ์„œ ๋กœ ์ด๋™ ํ•ด์ค€๋‹ค.

์ €์žฅ์†Œ๋ฅผ ์‚ฌ์šฉํ•  repo ๋ช…์„ ์ž…๋ ฅํ•ด ์ค€ ํ›„

image-06 (๋ฐฉ๊ธˆ ์ƒ์„ฑํ•œ Comments ๋ฅผ ์ ์šฉ ์‹œ์ผœ์ค€๋‹ค.)


ํ•˜๋‹จ์— ๋‚˜์˜ค๋Š” script-tag ๋ฅผ ๋ณต์‚ฌํ•ด์ค€๋‹ค.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script src="https://giscus.app/client.js"
        data-repo="[ENTER REPO HERE]"
        data-repo-id="[ENTER REPO ID HERE]"
        data-category="[ENTER CATEGORY NAME HERE]"
        data-category-id="[ENTER CATEGORY ID HERE]"
        data-mapping="pathname"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="bottom"
        data-theme="dark"
        data-lang="ko"
        crossorigin="anonymous"
        async>
</script>

5. Jekyll ์— ์„ค์ • ๋ถ€์—ฌํ•˜๊ธฐ

_config.xml ์œผ๋กœ ์ด๋™ ํ•œ ํ›„

1
2
3
4
5
6
7
8
9
10
comments:
  active: giscus 

        # ์ค‘๋žต

  giscus:
    repo: # ์‚ฌ์šฉํ•  ๋ ˆํฌ ๋ช…
    repo_id: # ๋ณต์‚ฌํ•ด ์™”๋˜ script ๋‚ด repo_id
    category: # script ๋‚ด category ๊ฐ’ ์ž…๋ ฅ
    category_id: # script ๋‚ด category_id ๊ณ ์œ  ๊ฐ’ ์ž…๋ ฅ

6. Dark / Light mode Theme ๋ถ€์—ฌํ•˜๊ธฐ

image-07 (_includes > comments > giscus.html ๋กœ ์ด๋™ํ•œ๋‹ค)

1
2
3
4
5
6
7
8
9
10
<!-- https://giscus.app/ -->
<script type="text/javascript">
  (function () {
    const origin = 'https://giscus.app';
    const iframe = 'iframe.giscus-frame';
    const lightTheme = 'light_protanopia';
    const darkTheme = 'noborder_dark';

    let initTheme = lightTheme;
    const html = document.documentElement;

ํ•ด๋‹น ํƒœ๊ทธ ๋‚ด lightTheme ๊ณผ darkTheme ์„ ์ „์— ๋ฐฉ๋ฌธํ–ˆ๋˜ giscus ์•ฑ ๋ฌธ์„œ

์—์„œ์˜ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์€ Theme ์„ ์ ์šฉํ•ด์ค€๋‹ค.

image-08 (์•„์ฃผ ์ด์˜๊ฒŒ ์ž˜ ์ ์šฉ ๋๋‹ค.)


๋งˆ์น˜๋ฉฐ

์•„๋ฌด๋ฆฌ ์ž˜ ๋งŒ๋“  ๋ธ”๋กœ๊ทธ์—ฌ๋„ ๋Œ“๊ธ€ ๊ธฐ๋Šฅ์ด ์—†์œผ๋ฉด ๊ทธ์ € ๋ฉ”๋ชจ ์ž‘์„ฑ์— ๋ถˆ๊ณผํ•œ ๊ฒƒ ๊ฐ™์•„ ์‹œ์ž‘ํ–ˆ๋Š”๋ฐ,

์ƒ๊ฐ๋ณด๋‹ค ๊ฒฐ๊ณผ๋ฌผ์ด ์ž˜๋‚˜์˜จ ๊ฒƒ ๊ฐ™๊ณ  ๊ฐ„๋‹จํ•ด์„œ ๋†€๋ž๋‹ค.

๋Œ€์„ฑ๊ณต ๋Œ€๋งŒ์กฑ

This post is licensed under CC BY 4.0 by the author.