- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
Latest commit
108 lines (96 loc) · 3.63 KB
/
Copy pathindex.html
File metadata and controls
108 lines (96 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
layout: default
title: Home
---
{% assign lang_data = site.data["ko"] %}
<divclass="blog-hero" style="background-image: url('{{ site.hero_image }}')">
<divclass="hero-overlay">
<divclass="container">
<divclass="hero-text">
<h1>{{ lang_data.site.title | default: site.title }}</h1>
<pclass="hero-subtitle">{{ lang_data.site.description | default: site.description }}</p>
</div>
</div>
</div>
</div>
<mainclass="blog-main">
<divclass="container">
<divclass="blog-layout">
<sectionclass="posts-feed">
<divclass="section-header">
<h2>{{ lang_data.posts.recent }}</h2>
<ahref="/archive" class="view-all-link">{{ lang_data.posts.view_all }} →</a>
</div>
<divclass="posts-list">
{% assign korean_posts = site.posts | where: "lang", "ko" %}
{% for post in korean_posts %}
<articleclass="post-item">
<h3class="post-title">
<ahref="{{ post.url | relative_url }}">{{ post.title }}</a>
</h3>
<divclass="post-meta">
<timeclass="post-date">{{ post.date | date: lang_data.posts.date_format }}</time>
{% if post.categories and post.categories.size > 0 %}
<spanclass="post-category">
<ahref="/categories#{{ post.categories[0] | slugify }}">{{ post.categories[0] }}</a>
</span>
{% endif %}
</div>
{% if post.excerpt %}
<divclass="post-excerpt">
{{ post.excerpt | strip_html | truncate: 120 }}
</div>
{% endif %}
</article>
{% endfor %}
</div>
<navclass="pagination" id="pagination-nav" style="display:none">
<ahref="#" class="pagination-btn pagination-prev" id="prev-btn">← {{ lang_data.posts.prev_page }}</a>
<spanclass="pagination-info" id="page-info"></span>
<ahref="#" class="pagination-btn pagination-next" id="next-btn">{{ lang_data.posts.next_page }} →</a>
</nav>
</section>
</div>
</div>
</main>
<script>
(function(){
varPOSTS_PER_PAGE=10;
varposts=document.querySelectorAll('.posts-list .post-item');
if(posts.length<=POSTS_PER_PAGE)return;
vartotalPages=Math.ceil(posts.length/POSTS_PER_PAGE);
varparams=newURLSearchParams(window.location.search);
varcurrentPage=parseInt(params.get('page'))||1;
currentPage=Math.max(1,Math.min(currentPage,totalPages));
varnav=document.getElementById('pagination-nav');
varprevBtn=document.getElementById('prev-btn');
varnextBtn=document.getElementById('next-btn');
varpageInfo=document.getElementById('page-info');
varbasePath=window.location.pathname;
functionshowPage(page){
varstart=(page-1)*POSTS_PER_PAGE;
varend=start+POSTS_PER_PAGE;
for(vari=0;i<posts.length;i++){
posts[i].style.display=(i>=start&&i<end) ? '' : 'none';
}
pageInfo.textContent=page+' / '+totalPages;
if(page>1){
prevBtn.href=page===2 ? basePath : basePath+'?page='+(page-1);
prevBtn.classList.remove('disabled');
}else{
prevBtn.removeAttribute('href');
prevBtn.classList.add('disabled');
}
if(page<totalPages){
nextBtn.href=basePath+'?page='+(page+1);
nextBtn.classList.remove('disabled');
}else{
nextBtn.removeAttribute('href');
nextBtn.classList.add('disabled');
}
}
nav.style.display='';
showPage(currentPage);
window.scrollTo(0,0);
})();
</script>