Front-matter

Front-matter is a block of YAML or JSON at the beginning of the file that is used to configure settings for your writings. Front-matter is terminated by three dashes when written in YAML or three semicolons when written in JSON.

YAML

1
2
3
title: Hello World  
date: 2013/7/13 20:46:25
---

JSON

1
2
3
"title": "Hello World",  
"date": "2013/7/13 20:46:25"
;;;

Settings & Their Default Values

Setting Description Default
layout Layout
title Title
date Published date File created date
updated Updated date File updated date
comments Enables comment feature for the post true
tags Tags (Not available for pages)
categories Categories (Not available for pages)
permalink Overrides the default permalink of the post

Categories & Tags

Only posts support the use of categories and tags. Categories apply to posts in order, resulting in a hierarchy of classifications and sub-classifications. Tags are all defined on the same hierarchical level so the order in which they appear is not important.

Example

1
2
3
4
5
6
7
categories:  
- Sports
- Baseball
tags:
- Injury
- Fight
- Shocking

If you want to apply multiple category hierarchies, use a list of names instead of a single name. If Hexo sees any categories defined this way on a post, it will treat each category for that post as its own independent hierarchy.

Example

1
2
3
4
5
categories:  
- [Sports, Baseball]
- [MLB, American League, Boston Red Sox]
- [MLB, American League, New York Yankees]
- Rivalries
墨问非名 wechat
订阅我的公众号
听说,你想请我喝杯咖啡?☕️
0%