[Hexo][04] Summary of hexo blog operation

hexo daily command

create a new page or article.

1
hexo new [layout] <title>

most useful command hexo new post [title].

Layout Path content
post source/_posts blog article
page source new page at top
draft source/_drafts article draft

The default filename of the .md markdown file will be the title.
You can change the default filename by editing the new_post_name setting under the _config.yml of the blog.
You can add the following element to prefix your filename. For example, :year-:month-:day-:title.md.

delete all the cache and static file.

1
hexo clean

use after install a new plugins or having new setting.

generate static file.

1
hexo g

deploy the static file.

1
hexo d

deploy instantly after generate statoc file.

1
hexo g -d

localhost to preview the blog.

1
hexo s

backup the blog to git.

1
2
3
4
git add .
git commit -m "remark"
git push origin [branch name]
-- git push origin hexo

used plugins

A search function for the blog. You can check the original on GitHub.

install like this. Go to the root of your blog.

1
npm install hexo-generator-search --save

enable like this. Edit you blog _config.yml.

1
2
3
4
search:
path: search.xml
field: all
content: true

hexo-blog-encrypt

A plugins to encrypt your post. Only password holder can read you article.
check the original on GitHub.

install like this. Go to the root of your blog.

1
npm install hexo-blog-encrypt

enable like this. Edit you blog article.

1
2
3
4
5
---
title: Hello World
date: 2016-03-30 21:18:02
password: yourpassword123
---
Author: williamlun
Link: williamlun.github.io/2020/02/16/Log-hexo-summary/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.