Loading...

Loading...

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

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

JSON

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

Settings & Their Default Values

SettingDescriptionDefault
layoutLayoutconfig.default_layout
titleTitleFilename (posts only)
datePublished dateFile created date
updatedUpdated dateFile updated date
commentsEnables comment feature for the posttrue
tagsTags (Not available for pages)
categoriesCategories (Not available for pages)
permalinkOverrides the default permalink of the post. Permalink should end with / or .htmlnull
excerptPage excerpt in plain text. Use this plugin to format the text
disableNunjucksDisable rendering of Nunjucks tag {{ }}/{% %} and tag plugins when enabledfalse
langSet the language to override auto-detectionInherited from _config.yml
publishedWhether the post should be publishedFor posts under _posts, it is true, and for posts under _draft, it is false

Layout

The default layout is post, in accordance with the value of default_layout setting in _config.yml. When the layout is disabled (layout: false) in an article, it will not be processed with a theme. However, it will still be rendered by any available renderer: if an article is written in Markdown and a Markdown renderer (like the default hexo-renderer-marked) is installed, it will be rendered to HTML.

Tag plugins are always processed regardless of layout, unless disabled by the disableNunjucks setting or renderer.

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

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

categories:
  - [Sports, Baseball]
  - [MLB, American League, Boston Red Sox]
  - [MLB, American League, New York Yankees]
  - Rivalries
Comments
Data Loading...