本篇作簡要總結,不作過多展開,詳情請看前兩篇或官方文檔
創建名為
your_name.github.io
的 GitHub 倉庫-
簡單初始化
$ mkdir your_name.github.io $ cd your_name.github.io $ hexo init $ npm install hexo-deployer-git --save
若需要輸入 LaTex 數學公式,請鍵入下述命令,或者使用 Jacman 主題:
$ npm install hexo-math --save
-
下載需要的主題
$ git clone https://github.com/wzpan/hexo-theme-wixo.git themes/wixo $ npm install hexo-tag-bootstrap --save
若要更新主題,請鍵入
$ cd themes/wixo $ git pull
-
撰寫文章
- 新建草稿:
hexo new draft article01
- 發布草稿:
hexo publish article01
- 新建頁面:
hexo new page article02
- 新建普通文章:
hexo new article03
- 刪除文章:直接刪除文章對應的
.md
文件即可
- 新建草稿:
如果要修改文章 URL 形式為
類別/文件名
,請修改根目錄下的_config.yml
文件中的permalink
字段為:permalink: :category/:title/
。這要求在每一篇文章的開頭都加入categories: <value>
字段,把<value>
替換成文章對應的分類。沒有該字段的文章,會被分到uncategorized
分類下。