지킬 템플릿을 이용한 Obsidian publishing에 disqus 댓글창 다는 방법

를 이용한 옵시디언 무료 퍼블리싱이 가능하다.

disqus댓글창은 지킬에 달 수 있는 방법을 이미 지원하고 있다. 그렇다면 지킬을 이용한 템플릿을 이용하는만큼 댓글창도 또한 달 수 있다.

  1. _note 폴더 아래에 글을 쓸때 frontmatter에 comments: true 추가

  2. 지킬 템플릿의 _layouts 폴더 아래의 note.html 아래에 universal embed code를 붙여넣는다

전체 코드는

{% if page.comments %}
<div id="disqus_thread"></div>
<script>
    /**
    *  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
    *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables    */
    /*
    var disqus_config = function () {
    this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };
    */
    (function() { // DON'T EDIT BELOW THIS LINE
    var d = document, s = d.createElement('script');
    s.src = 'https://각자 달리 부여되는 주소.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endif %}

이런 형식이 된다.

잘 작동함.

이런식으로 수정한다면, 페이스북댓글창 등 다른 서비스들을 다는 것도 가능하다.

댓글 남기기