C.W.K.
Stream
Lesson 06 of 08 · published

Front matter — 파일 맨 위 YAML/TOML/JSON

~12 min · markdown, front-matter, yaml, static-sites

Level 0평문
0 XP0/64 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

본문 위의 메타데이터 블록

Front matter 는 Markdown 파일 맨 위의 구조화된 데이터 블록 — 제목, 날짜, 태그, draft 상태 같은 메타데이터. 정적 사이트 생성기 (Hugo, Jekyll, Astro, Next MDX, Eleventy) 가 front matter 읽어서 라우팅, 정렬, 인덱싱, 렌더링 결정. 그 아래는 일반 Markdown.

세 flavor

  • YAML--- 로 fence. 가장 흔함. Jekyll, Hugo, Astro, Next MDX, Pelican, Gatsby.
  • TOML+++ 로 fence. Hugo 의 선호 flavor. 따옴표 + 명시적 규율로 더 잘 읽혀.
  • JSON — 보통 ;;; 로 fence 또는 { ... } 블록. 덜 흔함; 일부 MDX 셋업이 native 지원.

흔한 키 (관행, spec 아님)

title, date, slug, tags, categories, draft, author, cover. 각 생성기는 자체 키 추가 (Hugo 의 weight, Jekyll 의 layout, permalink 등). 표준 리스트는 생성기 문서 봐.

YAML front matter 의 Norway 문제: YAML 1.1 의 tags: [no, yes, on, off][false, true, true, false] 로 파싱돼. 키워드처럼 보이는 string 값은 항상 quote: tags: ["no", "yes"]. YAML 트랙에서 깊이 다룰 거야.

Code

YAML front matter (가장 흔함)·markdown
---
title: "My First Post"
date: 2026-05-04
tags: [markdown, intro, gfm]
draft: false
---

# My First Post

The body of the document is normal Markdown.
TOML front matter (Hugo flavor)·markdown
+++
title = "My First Post"
date = 2026-05-04
tags = ["markdown", "intro", "gfm"]
draft = false
+++

# My First Post

The body of the document is normal Markdown.
JSON front matter (일부 MDX)·markdown
;;;
{
  "title": "My First Post",
  "date": "2026-05-04",
  "tags": ["markdown", "intro", "gfm"],
  "draft": false
}
;;;

# My First Post

External links

Exercise

프로젝트의 Markdown 파일 (README, journal entry, blog draft) 골라서 front matter 세 버전 — YAML, TOML, JSON — 작성. 같은 생성기 (Hugo 또는 Astro) 로 렌더링하고 결과 비교. 앞으로 commit 할 거 하나 골라서 이유 문서화.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.