工具 · Settle Down in Hexo
2021-12-28 16:53:06
# 工具(Tools)
记录一些Hexo维护相关的命令。
更换主题
Step 0: 在本地博客目录下打开 Git Bash。
Step 1: Clone Theme from Github:
1 | git clone https://github.com/zchengsite/hexo-theme-oranges.git themes/oranges |
Step 2: 编辑博客目录下的 _config.yml
:
1 | theme: oranges |
写作和发布
写作
- 新文章:
hexo new post <title>
- 新草稿:
hexo new draft <title>
。草稿不会显示在博客里。 - 发布草稿:
hexo publish draft <title>
。将草稿转成文章 (从_draft/
移动到_post/
)。
发布
- 预览 (start) :
hexo s
, 之后访问localhost:4000
。可以实时看到变化。 - 生成 (generate):
hexo g
。 - 部署 (deploy):
hexo d
,之后访问博客地址即可。 - 清除缓存 (clean):
hexo clean
,注意 generate 和 deploy 只会更新 .yml 设置和文章。因此在更改 css 文件后,需要在 generate 之前使用该命令清除缓存。
代码高亮配色
多行代码
在theme/{current_theme}/source/css/highlight.css
中更改配色。
1 |
|
多标签文章
使用以下格式给文章添加多个标签:
1 | title: Settle Down in Hexo |