Skip to content

Commit 8420d02

Browse files
댓글 시스템 추가 및 푸터 내용 다국어 지원 개선
- _config.yml 파일에 댓글 시스템 설정 추가 - _data/en.yml, _data/ja.yml, _data/ko.yml 파일에 푸터 관련 다국어 내용 추가 - _includes/footer.html 파일에서 다국어 지원을 위한 코드 수정 - _layouts/post.html 파일에서 이전 및 다음 포스트 네비게이션 다국어 지원 추가
1 parent 9e4fb55 commit 8420d02

6 files changed

Lines changed: 121 additions & 31 deletions

File tree

_config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ adsense:
1919
auto_ads: true
2020
show_ads: true
2121

22+
# Comments system
23+
comments:
24+
provider: utterances
25+
utterances:
26+
repo: realcoding/realcoding.github.io
27+
issue_term: pathname
28+
theme: github-light
29+
2230
# Build settings
2331
markdown: kramdown
2432
highlighter: rouge

_data/en.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ ui:
4343
rss_feed: "RSS Feed"
4444
translation_not_available: "Translation not available, redirecting to homepage"
4545

46-
posts:
47-
recent: "Recent Posts"
48-
view_all: "View All Posts"
49-
date_format: "%B %d, %Y"
50-
read_more: "Read More"
46+
footer:
47+
categories_title: "Categories"
48+
recent_posts_title: "Recent Posts"
49+
information_title: "Information"
50+
about_link: "About"
51+
archive_link: "Archive"
52+
privacy_link: "Privacy Policy"
53+
sitemap_link: "Sitemap"
54+
rss_link: "RSS Feed"
55+
copyright: "All rights reserved."
56+
powered_by: "Built with Jekyll and GitHub Pages"

_data/ja.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,16 @@ ui:
4141
next_post: "次の投稿"
4242
toggle_dark_mode: "ダークモード切り替え"
4343
rss_feed: "RSSフィード"
44-
translation_not_available: "翻訳がありません。ホームページに移動します"
44+
translation_not_available: "翻訳がありません。ホームページに移動します"
45+
46+
footer:
47+
categories_title: "カテゴリー"
48+
recent_posts_title: "最新記事"
49+
information_title: "情報"
50+
about_link: "概要"
51+
archive_link: "記事"
52+
privacy_link: "プライバシーポリシー"
53+
sitemap_link: "サイトマップ"
54+
rss_link: "RSSフィード"
55+
copyright: "全ての権利を保有します。"
56+
powered_by: "JekyllとGitHub Pagesで制作"

_data/ko.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ ui:
3939
rss_feed: "RSS 피드"
4040
translation_not_available: "번역이 없어 홈페이지로 이동합니다"
4141

42+
footer:
43+
categories_title: "카테고리"
44+
recent_posts_title: "최근 포스트"
45+
information_title: "정보"
46+
about_link: "소개"
47+
archive_link: "아카이브"
48+
privacy_link: "개인정보 처리방침"
49+
sitemap_link: "사이트맵"
50+
rss_link: "RSS 피드"
51+
copyright: "모든 권리 보유."
52+
powered_by: "Jekyll과 GitHub Pages로 제작"
53+
4254
language:
4355
name: "한국어"
4456
code: "ko"

_includes/footer.html

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<footer class="site-footer">
22
<div class="container">
3+
{% assign current_lang = page.lang | default: site.default_lang %}
4+
{% assign lang_data = site.data[current_lang] %}
5+
36
<div class="footer-content">
47
<div class="footer-section">
5-
<h3>{{ site.title }}</h3>
6-
<p>{{ site.description }}</p>
8+
<h3>{{ lang_data.site.title }}</h3>
9+
<p>{{ lang_data.site.description }}</p>
710
<div class="social-links">
811
{% if site.github_username %}
912
<a href="https://github.com/{{ site.github_username }}" class="social-link" target="_blank" rel="noopener">
@@ -27,23 +30,48 @@ <h3>{{ site.title }}</h3>
2730
</div>
2831

2932
<div class="footer-section">
30-
<h4>카테고리</h4>
33+
<h4>{{ lang_data.footer.categories_title }}</h4>
3134
<ul class="footer-links">
32-
{% assign categories = site.categories | sort %}
33-
{% for category in categories limit:5 %}
35+
{% assign lang_categories = '' | split: '' %}
36+
{% for post in site.posts %}
37+
{% assign post_lang = post.lang | default: site.default_lang %}
38+
{% if post_lang == current_lang %}
39+
{% for category in post.categories %}
40+
{% unless lang_categories contains category %}
41+
{% assign lang_categories = lang_categories | push: category %}
42+
{% endunless %}
43+
{% endfor %}
44+
{% endif %}
45+
{% endfor %}
46+
{% assign sorted_categories = lang_categories | sort %}
47+
{% for category in sorted_categories limit:5 %}
3448
<li>
35-
<a href="/categories#{{ category[0] | slugify }}">
36-
{{ category[0] }} ({{ category[1].size }})
49+
{% assign cat_count = 0 %}
50+
{% for post in site.posts %}
51+
{% assign post_lang = post.lang | default: site.default_lang %}
52+
{% if post_lang == current_lang and post.categories contains category %}
53+
{% assign cat_count = cat_count | plus: 1 %}
54+
{% endif %}
55+
{% endfor %}
56+
<a href="{% if current_lang != site.default_lang %}/{{ current_lang }}{% endif %}/categories#{{ category | slugify }}">
57+
{{ category }} ({{ cat_count }})
3758
</a>
3859
</li>
3960
{% endfor %}
4061
</ul>
4162
</div>
4263

4364
<div class="footer-section">
44-
<h4>최근 포스트</h4>
65+
<h4>{{ lang_data.footer.recent_posts_title }}</h4>
4566
<ul class="footer-links">
46-
{% for post in site.posts limit:5 %}
67+
{% assign lang_posts = '' | split: '' %}
68+
{% for post in site.posts %}
69+
{% assign post_lang = post.lang | default: site.default_lang %}
70+
{% if post_lang == current_lang %}
71+
{% assign lang_posts = lang_posts | push: post %}
72+
{% endif %}
73+
{% endfor %}
74+
{% for post in lang_posts limit:5 %}
4775
<li>
4876
<a href="{{ post.url | relative_url }}">
4977
{{ post.title | truncate: 30 }}
@@ -54,23 +82,23 @@ <h4>최근 포스트</h4>
5482
</div>
5583

5684
<div class="footer-section">
57-
<h4>정보</h4>
85+
<h4>{{ lang_data.footer.information_title }}</h4>
5886
<ul class="footer-links">
59-
<li><a href="{{ '/about' | relative_url }}">소개</a></li>
60-
<li><a href="{{ '/archive' | relative_url }}">아카이브</a></li>
61-
<li><a href="{{ '/privacy' | relative_url }}">개인정보 처리방침</a></li>
62-
<li><a href="{{ '/sitemap.xml' | relative_url }}">사이트맵</a></li>
63-
<li><a href="{{ '/feed.xml' | relative_url }}">RSS 피드</a></li>
87+
<li><a href="{% if current_lang != site.default_lang %}/{{ current_lang }}{% endif %}/about">{{ lang_data.footer.about_link }}</a></li>
88+
<li><a href="{% if current_lang != site.default_lang %}/{{ current_lang }}{% endif %}/archive">{{ lang_data.footer.archive_link }}</a></li>
89+
<li><a href="{{ '/privacy' | relative_url }}">{{ lang_data.footer.privacy_link }}</a></li>
90+
<li><a href="{{ '/sitemap.xml' | relative_url }}">{{ lang_data.footer.sitemap_link }}</a></li>
91+
<li><a href="{{ '/feed.xml' | relative_url }}">{{ lang_data.footer.rss_link }}</a></li>
6492
</ul>
6593
</div>
6694
</div>
6795

6896
<div class="footer-bottom">
6997
<div class="footer-bottom-content">
70-
<p>&copy; {{ 'now' | date: "%Y" }} {{ site.title }}. 모든 권리 보유.</p>
98+
<p>&copy; {{ 'now' | date: "%Y" }} {{ lang_data.site.title }}. {{ lang_data.footer.copyright }}</p>
7199
<p>
72100
<a href="https://jekyllrb.com/" target="_blank" rel="noopener">Jekyll</a>
73-
<a href="https://pages.github.com/" target="_blank" rel="noopener">GitHub Pages</a>제작
101+
<a href="https://pages.github.com/" target="_blank" rel="noopener">GitHub Pages</a>{{ lang_data.footer.powered_by }}
74102
</p>
75103
</div>
76104
</div>

_layouts/post.html

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,44 @@ <h1 class="post-title">{{ page.title }}</h1>
5858
<div class="container">
5959
<!-- 네비게이션 -->
6060
<nav class="post-navigation">
61-
{% if page.previous.url %}
61+
{% assign current_lang = page.lang | default: site.default_lang %}
62+
{% assign lang_data = site.data[current_lang] %}
63+
64+
<!-- 현재 언어의 이전 포스트 찾기 -->
65+
{% assign prev_post = null %}
66+
{% for post in site.posts %}
67+
{% assign post_lang = post.lang | default: site.default_lang %}
68+
{% if post_lang == current_lang and post.date < page.date %}
69+
{% assign prev_post = post %}
70+
{% break %}
71+
{% endif %}
72+
{% endfor %}
73+
74+
<!-- 현재 언어의 다음 포스트 찾기 -->
75+
{% assign next_post = null %}
76+
{% assign posts_reversed = site.posts | reverse %}
77+
{% for post in posts_reversed %}
78+
{% assign post_lang = post.lang | default: site.default_lang %}
79+
{% if post_lang == current_lang and post.date > page.date %}
80+
{% assign next_post = post %}
81+
{% break %}
82+
{% endif %}
83+
{% endfor %}
84+
85+
{% if prev_post %}
6286
<div class="nav-previous">
63-
<a href="{{ page.previous.url | relative_url }}">
64-
<span class="nav-label">이전 포스트</span>
65-
<span class="nav-title">{{ page.previous.title }}</span>
87+
<a href="{{ prev_post.url | relative_url }}">
88+
<span class="nav-label">{{ lang_data.ui.previous_post }}</span>
89+
<span class="nav-title">{{ prev_post.title }}</span>
6690
</a>
6791
</div>
6892
{% endif %}
6993

70-
{% if page.next.url %}
94+
{% if next_post %}
7195
<div class="nav-next">
72-
<a href="{{ page.next.url | relative_url }}">
73-
<span class="nav-label">다음 포스트</span>
74-
<span class="nav-title">{{ page.next.title }}</span>
96+
<a href="{{ next_post.url | relative_url }}">
97+
<span class="nav-label">{{ lang_data.ui.next_post }}</span>
98+
<span class="nav-title">{{ next_post.title }}</span>
7599
</a>
76100
</div>
77101
{% endif %}

0 commit comments

Comments
 (0)