제목 : “JeKyll 기반 블로그 만들기(Github 페이지) (3) – 서비스 추가”
태그: (Github 페이지, Jekyll)
카테고리: “GithubPage와 Jekyll”
날짜: 2020-10-16T11:29:00
last_modified_at: 2020-10-16T11:29:00
03. 서비스 추가
03.1 코멘트
이것이 제가 Github 페이지를 처음 접했을 때 설정만 했기 때문에 사용하지 않은 주된 이유입니다. 그 당시에는 자세히 들여다보지 않아서 DB를 붙일 방법도 없었고 정적으로만 사용할 수 있다는 것에 관심이 있다가 포기했습니다. 그런데 이번에 돌려받았을 때 Jekyll 위에 빌드가 가능하고 다양한 플러그인과 연동이 가능하다는 것을 알게 되어서 해보고 싶었습니다.
디스커스 서비스 잠금 및 설정(_config.yml) 각 게시물에 댓글을 달 수 있습니다. 간단한 정보를 입력하여 웹사이트를 추가하면범용 포함 코드주석을 표시할 위치에 코드를 붙여넣어 이를 확인할 수 있습니다. (제 경우는 포스트로 레이아웃을 사용했기 때문에 _layouts폴더의 posts.html에 추가했습니다.)
disqus댓글 기능 추가# _config.yml에 추가 (사용하는 테마별로 comment기능을 지원하지 않을 수 있음) # 댓글기능 comments: provider : "disqus" # false (default), "disqus", "discourse", "facebook", "staticman", "staticman_v2", "utterances", "custom" disqus: shortname : "(shortname)" # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- discourse: server : # https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963 , e.g.: meta.discourse.org facebook: # https://developers.facebook.com/docs/plugins/comments appid : num_posts : # 5 (default) colorscheme : # "light" (default), "dark" utterances: theme : # "github-light" (default), "github-dark" issue_term : # "pathname" (default) staticman: branch : # "master" endpoint : # "https://{your Staticman v3 API}/v3/entry/github/"- disqus – 범용 내장 코드 추가(
_layouts/posts.html) {% 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://username.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 %}

03.2 분석
댓글과 마찬가지로 통계는 github 사이트에서만 사용할 수 있는 것이 아닙니다. Google Analytics를 사용하면 블로그에 대한 통계적 평가가 가능합니다.
구글 애널리틱스귀하의 계정으로 접속하여 귀하의 웹을 추가하신 후 귀하의 웹 추적 ID를 귀하의 것으로 입력하십시오. _config.yml파일에 넣어
추적 ID애널리틱스 홈페이지 왼쪽 하단에 있습니다. 관리 > 속성 설정 안으로 들어가시면 확인하실 수 있습니다. (2020년 10월 16일 기준)
- 구글 애널리틱스
_config.yml(최소한의 오류로 _ 모든 주제가 다르기 때문에config파일확인) # Analytics analytics: provider : "google" # false (default), "google", "google-universal", "google-gtag", "custom" google: tracking_id : "user tracking id" anonymize_ip : false # true, false (default)

참조
https://hy1116.github.io/jekyll/JekyllAddService/