https://hexo.io/zh-tw/index.html
快速、簡單且強大的網誌框架
安裝Hexo Server
1 | $ npm install -g hexo-cli |
啟動Hexo Server
1 | $ hexo s -p 8080 |
s (server):啟動伺服器
-p (–port):設定你要的port
新增文章
1.新增post文章
1 | $ hexo new "your-article-title" |
1 | $ hexo new post "your-article-title" |
文章檔案產生在
source/_posts/沒填入
layout預設是:post,您可以透過修改_config.yml中的default_layout設定來指定預設佈局。
2.新增page頁面
1 | $ hexo new draft "your-article-title" |
文章檔案產生在
source/
3.新增draft草稿
1 | $ hexo new draft "your-article-title" |
文章檔案產生在
source/_drafts/
產生靜態檔 (generate)
1 | $ hexo generate |
生成的靜態檔案會在
/public/。–watch : Hexo 能夠監看檔案變更並立即重新產生靜態檔案。
佈署(deploy)到 GitHub
1 | $ hexo deploy |
這邊佈署指令會依照 _config.yml 中所設定的 deploy 作佈署。
blog/_config.yml1
2
3
4
5# Deployment
deploy:
type: git
repo: git@github.com:HaroldZhen/haroldzhen.github.io.git
branch: master
type:型態。
repo:儲存庫(Repository)網址。
branch:分支名稱。
快速發佈:
1.產生靜態檔後就佈署
1 | $ hexo -g d |
等於 hexo generate –deploy
2.佈署前產生靜態檔
1 | $ hexo -d g |
等於 hexo deploy –generate