Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

front-matter

The front-matter is the area at the top of the file separated by ---, used to specify the variables of individual files. For more information, please refer to Hexo official document: #front-matter

FieldMeaningValue TypeDefault Value
layoutLayout templateString-
titlePage titleString-
seo_titlePage titleStringpage.title
short_titlePage title (displayed in the group list)Stringpage.title
dateCreation timeDateFile creation time
updatedUpdate dateDateFile modification time
linkExternal article URLString-
musicInternal music controls[Object]-
robotsrobotsString-
keywordsPage keywordsString-
descriptionPage description, abstractString-
coverWhether to show the coverBooltrue
top_metaWhether to display the meta information at the top of the article or pageBooltrue
bottom_metaWhether to display the meta information at the bottom of the article or pageBooltrue
sidebarPage sidebarBool, Arraytheme.layout.*.sidebar
bodyPage body elementsArraytheme.layout.on_page.body
mathjaxWhether to render formulasBool, Stringfalse
thumbnailThumbnailStringfalse
iconsiconsArray[]
pinwhether to topBoolfalse

Fields unique to layout:post:

| Field | Meaning | Value Type | Default Value |
| :----------------- | :------------ | :------------- |: ------ |
| author | Article author | [Object] | config.author |
| categories | Categories | String, Array |-|
| tags | Tags | String, Array |-|
| toc | Whether to generate a directory | Bool | true |

author

| Field | Meaning | Value Type | Default Value |
| :----------------- | :------------ | :------------- |: ------ |
| name | Author name | String | config.author |
| avatar | Avatar | String | config.avatar |
| url | Link | String | config.url |

music

| Field | Must | Value Type |
| :----------------- | :------------ | :--------------- - |
| server | yes | netease, tencent, kugou, xiami, baidu |
| type | yes | song, playlist, album, search, artist |
| id | yes | song id / playlist id / album id / search keyword |

Top article

Set the following values ​​in front-matter:

front-matter
pin: true

Article classification

Multiple categories have two relationships, one is hierarchy (equivalent to folders), and the other is juxtaposition (equivalent to tags).

Multi-level classification:

front-matter
---
categories: [category A, category B]
---

or

front-matter
---
categories:
-Category A
-Category B
---

Parallel classification

front-matter
categories:
-[Category A]
-[Category B]

Multi-level + parallel classification

front-matter
categories:
-[Category A, Category B]
-[Category C, Category D]

Article Summary

Insert <!-- more --> in the article, the previous part is the abstract.

source code of an article
---
title: xxx
date: 2020-02-21
---

This is a summary

<!-- more -->

This is the text

Note: <!-- more --> There must be blank lines before and after <!-- more -->

Set article author

With support for multi-author jointly maintain a blog, so you can set up a separate authors:

front-matter
---
author:
name: Author
avatar: https://img.vim-cn.com/a1/d53c11fb5d4fd69529bc805d385fe818feb3f6.png
url: https://baidu.com
---

Import external articles

Using link, with customized article author information, you can display external articles or URLs in the article list, for example:

front-matter
---
layout: post
date: 2017-07-05
title: [] How to build an independent blog based on Hexo
categories: [Dev, Hexo]
tags:
-Hexo
author:
name: xaoxuu
avatar: https://gcore.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
url: https://xaoxuu.com
link: https://xaoxuu.com/blog/2017-07-05-hexo-blog/
---

![](https://img.vim-cn.com/d9/a9af7dc49fc0af8ca3e6dd2450a2f7095a87db.png)

Top

For any article or page, set pin: true to put it on the top page.

front-matter
---
pin: true
---

This will cause a small problem: the number of post cards on the homepage is more than the set value. If you have obsessive-compulsive disorder and want the number of each page to be the same, you can install a plug-in to achieve it, see: [#421](https://github.com/ volantis-x/hexo-theme-volantis/issues/421)

Do not archive

Articles stored in the _posts folder will generally appear on the archive page. If a post does not want to appear on the archive page:

front-matter
---
archive: false
---

User Exchange Area

This is only for communication between users. If you have any questions, please go to GitHub to submit an issue. Asking questions in the comment area will not receive any response from the developer!