Skip to content

Commit fdd619a

Browse files
committed
REvive posts
1 parent 567fe00 commit fdd619a

54 files changed

Lines changed: 700 additions & 113 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ reCaptcha:
5151
secret :
5252
atom_feed:
5353
path : # blank (default) uses feed.xml
54-
search : true # true, false (default)
55-
search_full_content : true # true, false (default)
54+
search : false # true, false (default)
55+
search_full_content : false # true, false (default)
5656
search_provider : # lunr (default), algolia, google
5757
algolia:
5858
application_id : # YOUR_APPLICATION_ID

_data/navigation.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,4 @@ main:
88

99
index:
1010

11-
docs:
12-
- title: About
13-
children:
14-
- title: "CV"
15-
url: /research/cv/
16-
17-
- title: Lecture Notes
18-
children:
19-
- title: "알고리즘"
20-
url: /tags/csed331/
21-
- title: "운영체제"
22-
url: /tags/csed312/
23-
- title: "인공지능"
24-
url: /tags/csed442/
11+
docs:

_includes/kb-page__taxonomy.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% comment %}
2+
A redesigned taxonomy block for a clean, aligned presentation.
3+
{% endcomment %}
4+
5+
<div class="taxonomy-block">
6+
{% if page.categories.size > 0 %}
7+
<div class="taxonomy-row">
8+
<span class="taxonomy-label">Categories</span>
9+
<div class="taxonomy-pills">
10+
{% for category in page.categories %}
11+
<a href="/knowledge_base/#{{ category | slugify }}" class="taxonomy-pill">{{ category }}</a>
12+
{% endfor %}
13+
</div>
14+
</div>
15+
{% endif %}
16+
17+
{% if page.tags.size > 0 %}
18+
<div class="taxonomy-row">
19+
<span class="taxonomy-label">Tags</span>
20+
<div class="taxonomy-pills">
21+
{% for tag in page.tags %}
22+
<a href="/knowledge_base/?tag={{ tag | slugify }}" class="taxonomy-pill">{{ tag }}</a>
23+
{% endfor %}
24+
</div>
25+
</div>
26+
{% endif %}
27+
</div>

_layouts/kb-post.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
layout: default
3+
---
4+
<div id="main" role="main">
5+
<article class="post--custom" itemscope itemtype="https://schema.org/CreativeWork">
6+
<div class="post__inner-wrap">
7+
8+
<div class="content-wrapper">
9+
<div class="post__content-main">
10+
<header class="post__header">
11+
{% if page.categories.size > 0 %}
12+
{% assign main_category = page.categories | first %}
13+
<a href="/knowledge_base/#{{ main_category | slugify }}" class="post__category-link">
14+
<span class="post__category">{{ main_category }}</span>
15+
</a>
16+
{% endif %}
17+
18+
<h1 id="page-title" class="post__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>
19+
</header>
20+
21+
<section class="page__content" itemprop="text">
22+
{{ content }}
23+
</section>
24+
</div>
25+
26+
{% if page.toc %}
27+
<aside class="post__toc-sidebar sticky">
28+
<nav class="toc">
29+
<header><h4 class="nav__title"><i class="fas fa-stream"></i> Contents</h4></header>
30+
{% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" %}
31+
</nav>
32+
</aside>
33+
{% endif %}
34+
</div>
35+
36+
<footer class="page__meta">
37+
{% include kb-page__taxonomy.html %}
38+
</footer>
39+
40+
{% include post_pagination.html %}
41+
</div>
42+
</article>
43+
</div>

_layouts/knowledge-base.html

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
layout: default
3+
---
4+
<div class="initial-content">
5+
<div id="main" role="main">
6+
<div class="kb-archive">
7+
<h1 class="page__title">{{ page.title | default: "Knowledge Base" }}</h1>
8+
9+
{% assign professional_posts = site.posts | where: "type", "profession" %}
10+
11+
{% assign all_tags_list = "" | split: "," %}
12+
{% for post in professional_posts %}
13+
{% if post.tags %}
14+
{% assign all_tags_list = all_tags_list | concat: post.tags %}
15+
{% endif %}
16+
{% endfor %}
17+
{% assign professional_tags = all_tags_list | uniq | sort %}
18+
19+
{% assign professional_categories = "" | split: "," %}
20+
{% for post in professional_posts %}
21+
{% assign professional_categories = professional_categories | concat: post.categories | uniq %}
22+
{% endfor %}
23+
{% assign professional_categories = professional_categories | sort %}
24+
25+
<div class="kb-tag-filter">
26+
<button class="kb-tag-pill active" data-tag="all">All</button>
27+
{% for tag in professional_tags %}
28+
<button class="kb-tag-pill" data-tag="{{ tag | slugify }}">{{ tag }}</button>
29+
{% endfor %}
30+
</div>
31+
32+
<div class="kb-category-grid">
33+
{% for category in professional_categories %}
34+
<a href="#{{ category | slugify }}" class="kb-category-card">
35+
<h3 class="title">{{ category }}</h3>
36+
{% assign count = 0 %}
37+
{% for post in professional_posts %}{% if post.categories contains category %}{% assign count = count | plus: 1 %}{% endif %}{% endfor %}
38+
<span class="count">{{ count }} Posts</span>
39+
</a>
40+
{% endfor %}
41+
</div>
42+
43+
{% for category in professional_categories %}
44+
<section id="{{ category | slugify }}" class="kb-category-section">
45+
<h2 class="archive__subtitle">{{ category }}</h2>
46+
<div class="kb-post-grid">
47+
{% for post in professional_posts %}
48+
{% if post.categories contains category %}
49+
{% comment %} --- Create a string of slugified tags --- {% endcomment %}
50+
{% capture processed_tags %}{% for tag in post.tags %}{{ tag | slugify }} {% endfor %}{% endcapture %}
51+
52+
<div class="kb-post-card" data-tags="{{ processed_tags | strip }}">
53+
<a href="{{ post.url | relative_url }}">
54+
<h4 class="title">{{ post.title }}</h4>
55+
<p class="excerpt">{{ post.excerpt | strip_html | truncatewords: 20 }}</p>
56+
<time class="date">{{ post.date | date: "%B %d, %Y" }}</time>
57+
</a>
58+
</div>
59+
{% endif %}
60+
{% endfor %}
61+
</div>
62+
</section>
63+
{% endfor %}
64+
</div>
65+
</div>
66+
</div>
67+
68+
<script>
69+
document.addEventListener('DOMContentLoaded', function() {
70+
const filterContainer = document.querySelector('.kb-tag-filter');
71+
const postCards = document.querySelectorAll('.kb-post-card');
72+
const categorySections = document.querySelectorAll('.kb-category-section');
73+
74+
// 필터를 적용하는 함수 (재사용을 위해 분리)
75+
function applyFilter(selectedTag) {
76+
// 1. 버튼 활성 상태 업데이트
77+
const allPills = filterContainer.querySelectorAll('.kb-tag-pill');
78+
allPills.forEach(pill => {
79+
if (pill.getAttribute('data-tag') === selectedTag) {
80+
pill.classList.add('active');
81+
} else {
82+
pill.classList.remove('active');
83+
}
84+
});
85+
86+
// 2. 포스트 카드 필터링
87+
postCards.forEach(card => {
88+
const cardTags = card.getAttribute('data-tags');
89+
if (selectedTag === 'all' || (cardTags && cardTags.includes(selectedTag))) {
90+
card.style.display = 'block';
91+
} else {
92+
card.style.display = 'none';
93+
}
94+
});
95+
96+
// 3. 비어있는 카테고리 섹션 숨기기
97+
categorySections.forEach(section => {
98+
const visibleCards = section.querySelectorAll('.kb-post-card[style*="display: block"]');
99+
if (visibleCards.length > 0) {
100+
section.style.display = 'block';
101+
} else {
102+
section.style.display = 'none';
103+
}
104+
});
105+
}
106+
107+
// 페이지 로드 시 URL 파라미터를 확인하여 필터 적용
108+
const urlParams = new URLSearchParams(window.location.search);
109+
const tagFromUrl = urlParams.get('tag');
110+
111+
if (tagFromUrl) {
112+
applyFilter(tagFromUrl);
113+
} else {
114+
applyFilter('all'); // 파라미터 없으면 'All' 상태로
115+
}
116+
117+
// 태그 버튼 클릭 이벤트
118+
if (filterContainer) {
119+
filterContainer.addEventListener('click', function(e) {
120+
if (e.target.classList.contains('kb-tag-pill')) {
121+
const selectedTag = e.target.getAttribute('data-tag');
122+
123+
// 필터 함수 호출
124+
applyFilter(selectedTag);
125+
126+
// URL 업데이트 (페이지 새로고침 없음)
127+
const newUrl = selectedTag === 'all'
128+
? window.location.pathname
129+
: `${window.location.pathname}?tag=${selectedTag}`;
130+
131+
history.pushState({tag: selectedTag}, '', newUrl);
132+
}
133+
});
134+
}
135+
});
136+
</script>

_pages/main/category-archive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
title: "Posts by Category"
33
layout: categories
44
permalink: /categories/
5-
author_profile: true
5+
author_profile: false
66
---

_pages/main/knowledge_base.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Knowledge Base"
3+
layout: knowledge-base
4+
permalink: /knowledge_base/
5+
author_profile: false
6+
---

_posts/Lecture-Notes/3-2/ai/2020-09-18-ai-2nd-week-1.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
title: "&#91;AI&#93; Search (1)"
3+
layout: kb-post
34
categories:
45
- Lecture Notes
56
tags:
6-
- ai
7-
- csed442
7+
- AI
8+
- CSED442
89
use_math: true
910
toc: true
1011
toc_sticky: true
12+
type: profession
1113
---
1214

1315
> 이 글은 포스텍 이근배 교수님의 CSED442 인공지능 수업의 강의 내용과 자료를 기반으로 하고 있습니다.

_posts/Lecture-Notes/3-2/ai/2020-09-19-ai-2nd-week-2.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
title: "&#91;AI&#93; Search (2)"
3+
layout: kb-post
34
categories:
45
- Lecture Notes
56
tags:
6-
- ai
7-
- csed442
7+
- AI
8+
- CSED442
89
use_math: true
910
toc: true
1011
toc_sticky: true
12+
type: profession
1113
---
1214

1315
> 이 글은 포스텍 이근배 교수님의 CSED442 인공지능 수업의 강의 내용과 자료를 기반으로 하고 있습니다.

_posts/Lecture-Notes/3-2/ai/2020-10-01-ai-3nd-week-1.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
title: "&#91;AI&#93; Constraint Satisfaction Problems (1)"
3+
layout: kb-post
34
categories:
45
- Lecture Notes
56
tags:
6-
- ai
7-
- csed442
7+
- AI
8+
- CSED442
89
use_math: true
910
toc: true
1011
toc_sticky: true
12+
type: profession
1113
---
1214

1315
> 이 글은 포스텍 이근배 교수님의 CSED442 인공지능 수업의 강의 내용과 자료를 기반으로 하고 있습니다.

0 commit comments

Comments
 (0)