GitHub Pages 카테고리, 태그 설정

less than 1 minute read

1. 메뉴 세팅

카테고리와, 태그를 메뉴에 먼저 추가해보자.

navigation.yml로 대체합니다.

# main links
main:
  - title: "Categories"
    url: /categories/
  - title: "Tags"
    url: /tags/
  • _config.yml의 아래 부분에 상세히 어떻게 세팅하는지 나와있다.
# Archives
#  Type
#  - GitHub Pages compatible archive pages built with Liquid ~> type: liquid (default)
#  - Jekyll Archives plugin archive pages ~> type: jekyll-archives
#  Path (examples)
#  - Archive page should exist at path when using Liquid method or you can
#    expect broken links (especially with breadcrumbs enabled)
#  - <base_path>/tags/my-awesome-tag/index.html ~> path: /tags/
#  - <base_path>/categories/my-awesome-category/index.html ~> path: /categories/
#  - <base_path>/my-awesome-category/index.html ~> path: /
category_archive:
  type: liquid
  path: /categories/
tag_archive:
  type: liquid
  path: /tags/

2. 카테고리와 태그 페이지를 작성하자.

  1. “_pages” 폴더를 생성한다.
  2. “category-archive.md”, “tag-archive.md” 파일을 생성한다.
# category-archive.md
---
title: "카테고리"
layout: categories
permalink: /categories/
author_profile: true
---
# tag-archive.md
---
title: "Posts by Tag"
permalink: /tags/
layout: tags
author_profile: true
---

Tags:

Categories:

Updated:

Leave a comment