Gatsby: Gatsby ๋ธ”๋กœ๊ทธ์— Disqus ๋Œ“๊ธ€์„ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๊นŒ?

์— ๋งŒ๋“  2016๋…„ 02์›” 20์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: gatsbyjs/gatsby

Gatsby ๋ธ”๋กœ๊ทธ์— Disqus ๋Œ“๊ธ€์„ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๊นŒ? https://github.com/gatsbyjs/gatsby ์—์„œ ๋‹จ๊ณ„๋ฅผ ์ง„ํ–‰ํ–ˆ์ง€๋งŒ Disqus ์ฃผ์„ ์˜ต์…˜์„ ํ†ตํ•ฉํ•  ์œ„์น˜๋ฅผ ํ™•์‹ ํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. ๋„์›€์„ ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

์‹ค์ œ๋กœ Disqus๋ฅผ ์œ„ํ•œ ์ •๋ง ๋ฉ‹์ง„ React ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค โ€” https://js.coach/?search=disqus

์ด๋ฅผ ๋งˆํฌ๋‹ค์šด ๋ž˜ํผ( wrappers/md.js )์— ์ถ”๊ฐ€ํ•˜๊ณ  ๊ฒŒ์‹œ๋ฌผ URL์„ ์ „๋‹ฌํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

๋ชจ๋“  3 ๋Œ“๊ธ€

์‹ค์ œ๋กœ Disqus๋ฅผ ์œ„ํ•œ ์ •๋ง ๋ฉ‹์ง„ React ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค โ€” https://js.coach/?search=disqus

์ด๋ฅผ ๋งˆํฌ๋‹ค์šด ๋ž˜ํผ( wrappers/md.js )์— ์ถ”๊ฐ€ํ•˜๊ณ  ๊ฒŒ์‹œ๋ฌผ URL์„ ์ „๋‹ฌํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

์ถ”๊ฐ€ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์ฐพ์•˜์ง€๋งŒ wrappers/md.js ํŒŒ์ผ ๋‚ด ์–ด๋””์— ํฌํ•จํ•ด์•ผ ํ•˜๋Š”์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

var ๋ฐ˜์‘ = ์š”๊ตฌ('๋ฐ˜์‘');
var ReactDisqusThread = require('๋ฐ˜์‘-disqus-thread');

var ์•ฑ = createClass({

handleNewComment: function(comment) {
    console.log(comment.text);
}

render: function () {
    return (
        <ReactDisqusThread
            shortname="example"
            identifier="something-unique-12345"
            title="Example Thread"
            url="http://www.example.com/example-thread"
            category_id="123456"
            onNewComment={this.handleNewComment}/>
    );
}

});

React.render( , document.getElementById('์ปจํ…Œ์ด๋„ˆ'));

์ด๊ฒƒ์€ "gatsby disqus comment" ๊ฒ€์ƒ‰์— ๋Œ€ํ•œ ์ƒ์œ„ ๊ฒฐ๊ณผ๋กœ ๋‚˜์˜ค๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ์ด์ œ ๊ณต์‹ react-disqus ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ https://github.com/disqus/disqus-react ์—ฌ๊ธฐ ์žˆ๊ณ  ๊ตฌ์„ฑ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ์ด https://mk.gg/add-disqus-comments-to-gatsby- ์— ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰