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
Field | Meaning | Value Type | Default Value |
---|---|---|---|
layout | Layout template | String | - |
title | Page title | String | - |
seo_title | Page title | String | page.title |
short_title | Page title (displayed in the group list) | String | page.title |
date | Creation time | Date | File creation time |
updated | Update date | Date | File modification time |
link | External article URL | String | - |
music | Internal music controls | [Object] | - |
robots | robots | String | - |
keywords | Page keywords | String | - |
description | Page description, abstract | String | - |
cover | Whether to show the cover | Bool | true |
top_meta | Whether to display the meta information at the top of the article or page | Bool | true |
bottom_meta | Whether to display the meta information at the bottom of the article or page | Bool | true |
sidebar | Page sidebar | Bool, Array | theme.layout.*.sidebar |
body | Page body elements | Array | theme.layout.on_page.body |
mathjax | Whether to render formulas | Bool, String | false |
thumbnail | Thumbnail | String | false |
icons | icons | Array | [] |
pin | whether to top | Bool | false |
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:
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:
|
or
|
Parallel classification
categories: |
Multi-level + parallel classification
categories: |
Article Summary
Insert <!-- more -->
in the article, the previous part is the abstract.
|
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:
|
Import external articles
Using link
, with customized article author information, you can display external articles or URLs in the article list, for example:
|
Top
For any article or page, set pin: true
to put it on the top page.
|
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:
|