๐ [GithubPages] Jekyll hydejack ํ๊ทธ ๊ธฐ๋ฅ ์ถ๊ฐ - 8
![๐ [GithubPages] Jekyll hydejack ํ๊ทธ ๊ธฐ๋ฅ ์ถ๊ฐ - 8](/assets/img/thumbnail/githubpages-thumbnail.png)
[GithubPages] Jekyll hydejack ํ๊ทธ ๊ธฐ๋ฅ ์ถ๊ฐ
- ๐ ํ๊ทธ(Tag)์ ๋ชฉ์ ๊ณผ ๊ธฐ๋ฅ ๊ตฌํ ๋ฐฉ๋ฒ
- โ ์ ํ๊ทธ๊ฐ ํ์ํ๊ฐ?
- โ ํ๊ทธ ๊ธฐ๋ฅ ๊ตฌํ ๋ฐฉ๋ฒ
- โ ํฌ์คํธ์ ํ๊ทธ ์ถ๊ฐํ๊ธฐ
- โ ๊ฐ ํ๊ทธ์ ๋ํด ๊ฐ๋ณ ํ์ด์ง ์์ฑ
- โ ํ๊ทธ ๋ชฉ๋ก์์ ํด๋น ํ์ด์ง๋ก ์ฐ๊ฒฐ
- โ ํ๊ทธ ๋ชฉ๋ก ๋ฆฌ์คํธ ๋ง๋ค๊ธฐ
- โ 1๋จ๊ณ: ์ฌ์ด๋๋ฐ ๋ฉ๋ด ์์
- โ
2๋จ๊ณ:
/tags/
ํ์ด์ง ๋ง๋ค๊ธฐ - โ
3๋จ๊ณ (์ ํ):
tag_titles.yml
๋ฐ์ดํฐ ๊ตฌ์ฑ - ๐ก ํ๊ทธ ์ ๋ฆฌ ํ
- โ
4๋จ๊ณ: ์คํ์ผ ์ถ๊ฐ (
my-style.scss
) - ๐ ๋ง๋ฌด๋ฆฌ
๐ ํ๊ทธ(Tag)์ ๋ชฉ์ ๊ณผ ๊ธฐ๋ฅ ๊ตฌํ ๋ฐฉ๋ฒ
๊ฐ๋ฐ ๋ธ๋ก๊ทธ๋ฅผ ์ด์ํ๋ฉด์ ๊ธ์ด ๋์ด๋ ์๋ก, ๊ธ๋ค์ ์ด๋ป๊ฒ ๋ถ๋ฅํ๊ณ ์ฐพ์๋ณด๊ธฐ ์ฝ๊ฒ ๋ง๋ค ์ ์์์ง ๊ณ ๋ฏผํ๊ฒ ๋๋ค.
์ด๋ ์ ์ฉํ๊ฒ ์ฐ์ด๋ ๊ธฐ๋ฅ์ด ๋ฐ๋ก ์นดํ
๊ณ ๋ฆฌ(Category) ์ ํ๊ทธ(Tag) ์ด๋ค.
โ ์ ํ๊ทธ๊ฐ ํ์ํ๊ฐ?
์นดํ
๊ณ ๋ฆฌ๋ ๋น๊ต์ ํฐ ๋ฒ์ฃผ๋ก ๊ธ์ ๋๋๋ ๋ฐ ์ฌ์ฉ๋๋ค.
์๋ฅผ ๋ค์ด Dev
, Study
๊ฐ์ ํฐ ์ฃผ์ ๋ฅผ ์นดํ
๊ณ ๋ฆฌ๋ก ๋๋๋ค.
๊ทธ์ ๋ฐํด, ํ๊ทธ๋ ๋ ์ ์ฐํ๊ณ ์ธ๋ถ์ ์ธ ๋ถ๋ฅ๋ฅผ ๊ฐ๋ฅํ๊ฒ ํ๋ค.
์์:
React
๋Dev
์นดํ ๊ณ ๋ฆฌ์ ํฌํจ๋์ง๋ง, ๋์์Frontend
,JSX
,SPA
๋ฑ ๋ค์ํ ๊ด์ ์ผ๋ก ํ๊น ๋ ์ ์๋ค.- ํ๋์ ๊ธ์ ์ฌ๋ฌ ํ๊ทธ๋ฅผ ๋ถ์ฌ ๋ค์ํ ํค์๋๋ก ์ฐ๊ฒฐ์ํฌ ์ ์๋ค.
์ฆ, ํ๊ทธ๋ ๊ธ ๊ฐ์ ์ฐ๊ด์ฑ์ ๊ฐ๋ณ๊ณ ์ง๊ด์ ์ผ๋ก ์ฐ๊ฒฐํด์ฃผ๋ ๋งํฌ ์ญํ ์ ํ๋ค.
โ ํ๊ทธ ๊ธฐ๋ฅ ๊ตฌํ ๋ฐฉ๋ฒ
โ ํฌ์คํธ์ ํ๊ทธ ์ถ๊ฐํ๊ธฐ
๊ธ์ ์๋จ Front Matter์ tags
ํ๋๋ฅผ ์ถ๊ฐํ๋ค.
---
layout: post
title: react
image:
path: /assets/img/blog/blog-basic.jpg
categories: [dev, react]
tags: [react, web]
description: >
A page showing Hydejack-specific markdown content.
---
โ ๊ฐ ํ๊ทธ์ ๋ํด ๊ฐ๋ณ ํ์ด์ง ์์ฑ
_featured_tags
ํด๋ ์์ ๊ฐ ํ๊ทธ์ ๋ํด ๊ฐ๋ณ ํ์ด์ง ์์ฑํ๋ค. ์๋ฅผ ๋ค์ด react, web ํ๊ทธ๋ฅผ ์์ฑํ๊ณ ์ถ๋ค๋ฉด react.md, web.md ์ฒ๋ผ ํ๊ทธ๋ง๋ค ํ๋์ฉ ์์ฑํ๋ค.
---
layout: tag-list
type: tag
title: React
slug: react
sidebar: true
description: >
about React
---
โ ํ๊ทธ ๋ชฉ๋ก์์ ํด๋น ํ์ด์ง๋ก ์ฐ๊ฒฐ
ํ๊ทธ ๋งํฌ๋ฅผ ์ ํํ์๋ ํ๊ทธ์ ๊ด๋ จ๋ ๊ฒ์๊ธ ๋ชฉ๋ก์ ๋ณด์ฌ์ค์ ์๋ _layout/tag-list.html
ํ์ด์ง๋ฅผ ๋ง๋ ๋ค. list.html
ํ์ด์ง๋ฅผ ์ฐธ๊ณ ํด์ ๋ง๋ค๋ฉด๋๋ค.
---
layout: page
---
{%include components/pagination.html %}
{{ content }}
{% assign posts = site.tags[page.slug] %}
{% assign date_formats = site.data.strings.date_formats %}
{% assign list_group_by = date_formats.list_group_by | default:"%Y" %}
{% assign list_entry = date_formats.list_entry | default:"%d %b" %}
{% for post in posts %}
{% assign currentdate = post.date | date:list_group_by %}
{% if currentdate != date %}
{% unless forloop.first %}</ul>{% endunless %}
<h2 id="{{ list_group_by | slugify }}-{{ currentdate | slugify }}" class="hr">{{ currentdate }}</h2>
<ul class="related-posts">
{% assign date = currentdate %}
{% endif %}
{% include components/post-list-item.html post=post format=list_entry %}
{% if forloop.last %}</ul>{% endif %}
{% endfor %}
Hydejack ํ
๋ง๋ ๊ธฐ๋ณธ์ ์ผ๋ก ํ๊ทธ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ค. ์ด์ ๊ธฐ๋ณธ์ ์ธ ํ๊ทธ ์
ํ
์ ๋๋ฌ๋ค. ์๊น ์ฒ์์ ๋งํ ๊ธ์ ์๋จ Front Matter ํ๊ทธ ํ๋๋ฅผ ์ถ๊ฐํ ๊ฒ์๋ฌผ์ ๋ค์ด๊ฐ๋ณด๋ฉด ์๋จ์ ํ๊ทธ ๋ชฉ๋ก(#React, #Web
)์ด ๋ณด์ผ ๊ฒ์ด๋ค.
โ ํ๊ทธ ๋ชฉ๋ก ๋ฆฌ์คํธ ๋ง๋ค๊ธฐ
์ด ํ๊ทธ ํ์ด์ง๋ ๋ค์๊ณผ ๊ฐ์ ๋ชฉ์ ์ ๋ฌ์ฑํ๊ธฐ ์ํด ๊ตฌํ๋์๋ค:
- ๊ธ ์๊ฐ ๋ง์์ก์ ๋, ์ฃผ์ ๋ณ๋ก ๋ถ๋ฅํ๊ณ ์ฐ๊ฒฐํ๋ ๊ธฐ๋ฅ
- ๋ธ๋ก๊ทธ ํ์์ ๋ ์ฝ๊ฒ ๋ง๋ค๊ธฐ ์ํ UI ๊ฐ์
- ์ฌ์ด๋๋ฐ ๋ฉ๋ด์ Tags๋ฅผ ์ถ๊ฐํ๊ณ
/tags/
ํ์ด์ง์์ ์ ์ฒด ํ๊ทธ ๋ชฉ๋ก์ ๊น๋ํ๊ณ ๊ทธ๋ฆฌ๋ ํํ๋ก ๋ณด์ฌ์ฃผ๋ ๊ฒ์ด๋ค.
โ 1๋จ๊ณ: ์ฌ์ด๋๋ฐ ๋ฉ๋ด ์์
_config.yml
์ menu:
ํญ๋ชฉ์ ๋ค์๊ณผ ๊ฐ์ด ์์ ํ๋ค.
menu:
- title: Dev
url: /dev/
submenu:
- title: Spring
url: /spring/
- title: React
url: /react/
- title: Study
url: /study/
submenu:
- title: Algorithm
url: /algorithm/
- title: Data Structure
url: /ds/
- title: ETC
url: /etc/
- title: Tags # โ ์ฌ๊ธฐ๋ฅผ ์ถ๊ฐ
url: /tags/
- title: About
url: /about/
โ
2๋จ๊ณ: /tags/
ํ์ด์ง ๋ง๋ค๊ธฐ
tags.md
_pages
ํด๋ ์์ ์์ฑ- ๋ฃจํธ ๋๋ ํฐ๋ฆฌ์ ์์ฑํ๋ฉด ์๋์ธ์ ๋์ง๋ง
_pages
ํด๋ ์์ ๋ฃ์ด์ ๊ด๋ฆฌํ๊ณ ์ถ์ผ๋ฉด _config.yml
์์ collections์ pages ์ถ๊ฐ
# file: '_config.yml'
collections:
pages:
output: true
permalink: /:name/
- ์ ๋ชฉ์ โTagsโ
- ์ฃผ์๋
https://๋ด๋ธ๋ก๊ทธ์ฃผ์/tags/
์ ์ ๊ฐ๋ฅํ๊ฒ ์ค์
---
layout: sidebar-tags
title: "Tags"
permalink: /tags/
---
sidebar-tags.html
ํ์ผ์ _layout
ํด๋์ ์์ฑ
---
layout: default
---
{% assign tag_titles = site.data.tag_titles %}
{% assign tag_slugs = site.data.tag_slugs %}
{% assign sorted_tags = site.tags | sort %}
<h1 class="page-title">Tags</h1>
<div class="tag-grid">
{% for tag in sorted_tags %}
{% assign tag_name = tag[0] %}
{% assign title = tag_titles[tag_name] | default: tag_name %}
{% assign slug = tag_slugs[tag_name] | default: tag_name | slugify %}
<a href="/tag-{{ slug }}/" class="tag-box">
<span class="tag-name">#{{ title }}</span>
<span class="tag-count">{{ tag[1].size }}</span>
</a>
{% endfor %}
</div>
<p class="faded fine" style="margin-top: 2rem;">
์ํ๋ ์ฃผ์ ์ ํ๊ทธ๋ฅผ ํด๋ฆญํ๋ฉด ํด๋น ๊ธ ๋ชฉ๋ก์ผ๋ก ์ด๋ํฉ๋๋ค.
</p>
_data/tag_titles.yml
: ํ๊ทธ์ ํ์ ์ด๋ฆ(title) ๋งคํ{% assign sorted_tags = site.tags | sort %}
- Jekyll์
site.tags
๋ ๋ชจ๋ ํ๊ทธ์ ํด๋น ๊ธ ๋ชฉ๋ก์ ๋ด๊ณ ์์ - ์ํ๋ฒณ์์ผ๋ก ์ ๋ ฌํด์ ๋ณด์ฌ์ฃผ๊ธฐ ์ํจ
โ
3๋จ๊ณ (์ ํ): tag_titles.yml
๋ฐ์ดํฐ ๊ตฌ์ฑ
ํ์ฌ ์ค์ ๋ ํ๊ทธ๋ค์ ์์๋ฌธ์๋ก ์ถ๋ ฅ์ ์ํ๋ฉด 3๋จ๊ณ๋ ๊ฑด๋๋์ด๋ ๋๋ค.. ๋๋ ํ๋ฉด์ ๋ณด์ฌ์ค๋ ๋๋ฌธ์๊ฐ ๋ค์ด๊ฐ๊ธธ ์ํ๋ค. ์๋ฅผ๋ค์ด algorithm์ Algorithm์ผ๋ก ํํํ๋ ค๊ณ ํ๋ค. ๊ทธ๋ ๊ธฐ์ ํ๊ทธ title ๋งคํ์ ํ๊ธฐ์ํด _data/tag_titles.yml
์์ฑํ๋ค.
# file: _data/tag_titles.yml
algorithm: Algorithm
git: Git
data-structure: Data Structure
react: React
spring: Spring
web: Web
codingtest: CodingTest
jekyll: Jekyll
markdown: Markdown
๐ก ํ๊ทธ ์ ๋ฆฌ ํ
- ๊ฐ๋ฅํ ํ ์งง๊ณ ๋ช
ํํ ๋จ์ด๋ก ํ๊ทธ๋ฅผ ๋ง๋ ๋ค.
- ์:
data-structure
๋ณด๋ค๋ds
,algorithm
์ ํ๊ทธ๋ก
- ์:
- ์ค๋ณต/์ ์ฌ ํ๊ทธ ๋ฐฉ์ง (์:
React
,react
,ReactJS
๋ฅผ ํ๋๋ก ํต์ผ) - ํ๊ทธ๋ ๊ฒ์ ํค์๋์ด์ ์ฐ๊ฒฐ ๊ณ ๋ฆฌ์ด๊ธฐ ๋๋ฌธ์ ์ ๋ต์ ์ผ๋ก ๊ด๋ฆฌํ ์๋ก ๋ธ๋ก๊ทธ ํ์์ด ์ฌ์์ง๋ค.
โ
4๋จ๊ณ: ์คํ์ผ ์ถ๊ฐ (my-style.scss
)
css ์คํ์ผ์ ์ธ ๋ถ๋ถ์ ๋๋ถ๋ถ ์ฑgpt์ ์์ฒญ์ ํ๋ค..๐คฃ
.tag-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 1rem;
margin-top: 2rem;
}
.tag-box {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
border: 1px solid var(--border);
border-radius: 0.75rem;
text-decoration: none;
color: var(--text);
background: var(--bg);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
transition: 0.2s ease-in-out;
}
.tag-box:hover {
background-color: var(--highlight);
color: var(--accent);
transform: scale(1.02);
}
.tag-name {
font-weight: bold;
}
.tag-count {
font-size: 0.9rem;
color: var(--text-light);
}
์์ฑ๋ ํ๋ฉด์ ๋๋ค. ํ๊ทธ๊ฐ ๋ง์ง ์์์ ์๋ซ์ชฝ ๋น ๊ณต๊ฐ์ด ๋ง์ด ๋จ๋๋ค. ๋จ๋ ๋ถ๋ถ์ ์์ ๋กญ๊ฒ ์ํ๋ ์์๋ฅผ ์ถ๊ฐํด์ฃผ๋ฉด ๋๋ค. ์ต๊ทผ ๊ฒ์๋ฌผ ์ถ๊ฐ, ํ๊ทธ ์ค๋ช ์๋ด๋ฌธ๊ตฌ?, ์ธ๊ธฐ ํ๊ทธ(GA(Google Analytics)์ ์ฐ๋ํด์ ์๋ํ ๊ฐ๋ฅ), ๋๋ค ๊ธ ๋ณด๊ธฐ, ๋๊ธ์ฐฝ ๋ฑ๋ฑ ๋ฃ์ผ๋ฉด ๋๋ค.
Search ํ์ด์ง์๋ ๋น๊ณต๊ฐ์ด ๋จ์์ ํ๊ทธ ๋ชฉ๋ก์ ๋ฃ์ด์คฌ๋ค. Pages ๋ถ๋ถ์ ๊ฑท์ด๋ด๊ณ ์ฝ๋๋ฅผ ๋ฃ์ด์ฃผ๋ฉด ๋๋ค.
# file: 'default.html'
{% assign tag_titles = site.data.tag_titles %}
{% assign sorted_tags = site.tags | sort %}
<h2 class="hr-bottom">{{ strings.tags | default: "Tags" }}</h2>
<div class="tag-grid">
{% for tag in sorted_tags %}
{% assign tag_name = tag[0] %}
{% assign title = tag_titles[tag_name] | default: tag_name %}
{% assign slug = tag_name %}
<a href="/tag-{{ slug }}/" class="tag-box">
<span class="tag-name">{{ title }}</span>
<span class="tag-count">({{ tag[1].size }})</span>
</a>
{% endfor %}
</div>
<p class="faded fine" style="margin-top: 2rem;">
์ํ๋ ์ฃผ์ ์ ํ๊ทธ๋ฅผ ํด๋ฆญํ๋ฉด ํด๋น ๊ธ ๋ชฉ๋ก์ผ๋ก ์ด๋ํฉ๋๋ค.
</p>
์ง์ ์์ฑ โบ๏ธ
๐ ๋ง๋ฌด๋ฆฌ
๋ด๊ฐ ๋ธ๋ก๊ทธ์ ํ๊ทธ ๊ธฐ๋ฅ์ ๊ตฌํํ ๊ฐ์ฅ ํฐ ์ด์ ๋ ๋ค์๊ณผ ๊ฐ๋ค:
- ๊ธ์ด ๋ง์์ง์๋ก ์ ๋ฆฌ์ ๊ฒ์์ด ์ด๋ ค์์ง๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ณ ์ถ์๋ค.
- ๋ ์์๊ฒ๋, ๋์๊ฒ๋ ๋น ๋ฅด๊ฒ ๊ด๋ จ ๊ธ์ ์ฐพ์ ์ ์๋ ์ฐ๊ฒฐ ํต๋ก๊ฐ ๋๊ธฐ ๋๋ฌธ์ด๋ค.
- ์์ผ๋ก ๊ธ์ด ๋ ๋ง์์ง์๋ก, ํ๊ทธ๋ ๋ธ๋ก๊ทธ์ ์ค์ํ ์ ๋ณด ๊ตฌ์กฐ ์ค ํ๋๊ฐ ๋ ๊ฒ์ด๋ค.