hexo 使用速查手册

hexo 使用速查手册

markdown 行末两个空格插入空行

系统篇

源文件

https://hexo.io/docs/setup#source

Front Matter

layout: false don’t process my post
title:
date:
updated:
comments:
tags:
categories:
permalink:
keywords:
excerpt: ‘’

toc_max_depth
reward
mathjax

资源文件夹

asset folder https://hexo.io/docs/asset-folders

自动化部署

deployment: npm install hexo-deployer-git —save

写作篇

创建新页面

new command

scaffold

read more

插入公式

math

Emoji

emoji

标签

官方标签

https://hexo.io/docs/tag-plugins

block quote https://hexo.io/docs/tag-plugins#Block-Quote

code block https://hexo.io/docs/tag-plugins#Code-Block

iframe https://hexo.io/docs/tag-plugins#iframe

image https://hexo.io/docs/tag-plugins#Image

link https://hexo.io/docs/tag-plugins#Link

include code https://hexo.io/docs/tag-plugins#Include-Code

include posts https://hexo.io/docs/tag-plugins#Include-Posts

include assets https://hexo.io/docs/tag-plugins#Include-Assets

raw https://hexo.io/docs/tag-plugins#Raw

post excerpt https://hexo.io/docs/tag-plugins#Post-Excerpt

主题标签

next

https://theme-next.org/docs/tag-plugins/
centered quote https://theme-next.org/docs/tag-plugins/#Centered-Quote
include raw https://theme-next.org/docs/tag-plugins/#Include-Raw

pdf https://github.com/theme-next/theme-next-pdf
tabs https://theme-next.org/docs/tag-plugins/tabs
note https://theme-next.org/docs/tag-plugins/note
label https://theme-next.org/docs/tag-plugins/label
button https://theme-next.org/docs/tag-plugins/button
mermaid https://theme-next.org/docs/tag-plugins/mermaid
group picture https://theme-next.org/docs/tag-plugins/group-pictures
github-emoji https://github.com/theme-next/hexo-filter-emoji

附录1 hexo 命令行参数

Usage: hexo \

Commands:
clean Remove generated files and cache.

deploy Deploy your website.
Options:
—setup Setup without deployment
-g, —generate Generate before deployment

generate Generate static files.
Options:
-b, —bail Raise an error if any unhandled exception is thrown during generation
-d, —deploy Deploy after generated
-f, —force Force regenerate
-w, —watch Watch file changes

new Create a new post.
Arguments:
layout Post layout. Use post, page, draft or whatever you want.
title Post title. Wrap it with quotations to escape.

Options:
-p, --path     Post path. Customize the path of the post.
-r, --replace  Replace the current post if existed.
-s, --slug     Post slug. Customize the URL of the post.

init Create a new Hexo folder.
Arguments:
destination Folder path. Initialize in current folder if not specified

Options:
--no-clone    Copy files instead of cloning from GitHub
--no-install  Skip npm install

server Start the server.
Options:
-i, —ip Override the default server IP. Bind to all IP address by default.
-l, —log [format] Enable logger. Override log format.
-o, —open Immediately open the server url in your default web browser.
-p, —port Override the default port.
-s, —static Only serve static files.

BELOW ARE NOW VERY USEFUL

config Get or set configurations.
Arguments:
name Setting name. Leave it blank if you want to show all configurations.
value New value of a setting. Leave it blank if you just want to show a single configuration.

help Get help on a command.

list List the information of the site
Arguments:
type Available types: page, post, route, tag, category

migrate Migrate your site from other system to Hexo.
Arguments:
type Migrator type.

publish Moves a draft post from _drafts to _posts folder.
Arguments:
filename Draft filename. “hello-world” for example.
layout Post layout. Use post, page, draft or whatever you want.

render Render files with renderer plugins.
Options:
—engine Specify render engine
—output Output destination. Result will be printed in the terminal if the output destination is not set.
—pretty Prettify JSON output

version Display version information.

附录2 TroubleShooting

  1. tag 未关闭
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Template render error: (unknown path)
unexpected end of file
at Object._prettifyError (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\nunjucks\src\lib.js:36:11)
at Template.render (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\nunjucks\src\environment.js:542:21)
at Environment.renderString (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\nunjucks\src\environment.js:380:17)
at Promise.fromCallback.cb (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\hexo\lib\extend\tag.js:123:48)
at tryCatcher (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\util.js:16:23)
at Function.Promise.fromNode.Promise.fromCallback (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\promise.js:209:30)
at Tag.render (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\hexo\lib\extend\tag.js:123:18)
at Object.onRenderEnd (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\hexo\lib\hexo\post.js:280:20)
at Promise.then.then.result (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\hexo\lib\hexo\render.js:64:19)
at tryCatcher (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues (C:\Users\v-haiyli\Desktop\GitHub\hexo-blog\node_modules\bluebird\js\release\async.js:15:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
如果这篇文章对您有用,可以考虑打赏:)