Skip to content

Commit e584c13

Browse files
committed
블로그 게시물의 커뮤니티 자동 게시 기능 추가
1 parent 7f6b477 commit e584c13

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ keep_files: [
6161
docs/master/_static/js/vendor/
6262
]
6363
repository: PyTorchKorea/pytorch.kr
64+
variables:
65+
community_discourse_id: bot
6466
external_urls:
6567
org_www: https://pytorch.org
6668
org_docs: https://pytorch.org/docs

_includes/blog_comments.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div class="blog-comment">
2+
<div class="container">
3+
<div id="discourse-comments"></div>
4+
<meta name="discourse-username" content="{{ site.variables.community_discourse_id }}">
5+
</div>
6+
</div>
7+
8+
<script type="text/javascript">
9+
DiscourseEmbed = {
10+
discourseUrl: '{{ site.external_urls.site_community }}',
11+
discourseEmbedUrl: '{{ site.url }}{{ page.url }}',
12+
// className: 'CLASS_NAME',
13+
};
14+
15+
(function() {
16+
var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
17+
d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
18+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
19+
})();
20+
</script>

_layouts/blog_detail.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ <h4 class="blog-subtitle">{{ page.org_title }}</h4>
4444
번역 글은 원문을 함께 표시합니다. 원문으로 이동하시려면 <a href="{{ page.org_link }}">여기</a>를 클릭하세요.
4545
</p>
4646
{% endif %}
47-
{{ content }}
47+
<div class="blog-content">
48+
{{ content }}
49+
</div>
4850
<hr noshade />
4951
<p class="translation-description ad-discuss">
5052
{% if page.discuss_id %}이 주제와 관련하여 {% endif %} 더 궁금하시거나 나누고 싶은 이야기가 있으신가요? <a href="{{ site.external_urls.site_community }}{% if page.discuss_id %}{{ page.discuss_id | prepend: '/t/' }}{% endif %}">파이토치 한국어 커뮤니티에 참여</a>해주세요!
@@ -54,6 +56,8 @@ <h4 class="blog-subtitle">{{ page.org_title }}</h4>
5456
</div>
5557
</div>
5658

59+
{% include blog_comments.html %}
60+
5761
{% include footer.html %}
5862
</body>
5963
</html>

0 commit comments

Comments
 (0)