-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcategories.html
More file actions
64 lines (57 loc) · 2.99 KB
/
Copy pathcategories.html
File metadata and controls
64 lines (57 loc) · 2.99 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
---
title: "Categories"
layout: default
description: "백엔드 개발 포스트 모음 — Algorithm, Spring Boot, Kotlin, System Design 등 카테고리별로 정리된 기술 블로그 글 목록입니다."
no-catalog: true
nav-order: 2.5
---
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<h1 class="page-heading">Categories</h1>
<div class="cat-grid-section">
{% comment %} Build categories sorted by frequency (most posts first) {% endcomment %}
{% capture cats_with_count %}
{% for cat in site.categories %}
{{ cat[1].size | prepend: "0000" | slice: -4, 4 }}::{{ cat[0] }}{% unless forloop.last %}|||{% endunless %}
{% endfor %}
{% endcapture %}
{% assign cats_with_count_clean = cats_with_count | strip_newlines | strip %}
{% assign sorted_cat_items = cats_with_count_clean | split: "|||" | sort | reverse %}
<div class="cat-card-grid">
{% for item in sorted_cat_items %}
{% assign parts = item | split: "::" %}
{% assign cat_name = parts[1] | strip %}
{% if cat_name == "" %}{% continue %}{% endif %}
{% assign cat_posts = site.categories[cat_name] %}
{% include cat-meta.html %}
<div class="cat-card cat-card--{{ cat_name }}">
<div class="cat-card-accent"></div>
<div class="cat-card-icon">
<svg class="icon" aria-hidden="true"><use href="#{{ cat_icon }}"/></svg>
</div>
<div class="cat-card-body">
<div class="cat-card-header">
<h2 class="cat-card-name">{{ display_name }}</h2>
<span class="cat-card-count">{{ cat_posts.size }} posts</span>
</div>
{% if cat_desc != "" %}
<p class="cat-card-desc">{{ cat_desc }}</p>
{% endif %}
<ul class="cat-card-posts">
{% assign sorted_posts = cat_posts | sort: "date" | reverse %}
{% for post in sorted_posts limit:3 %}
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></li>
{% endfor %}
{% if sorted_posts.size > 3 %}
<li class="cat-card-more">and {{ sorted_posts.size | minus: 3 }} more...</li>
{% endif %}
</ul>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>