Hexo 使用

command

Install Hexo

1
Install Hexo

Dump version

1
hexo version

inition Blog

1
hexo init blog

產生靜態檔後部署

1
hexo d -g 

產生靜態檔後預覽

1
hexo s -g 

啟動伺服器

1
hexo server (hexo s)

產生靜態檔案

1
hexo generate (hexo g)

變更連接埠

1
hexo server -p 5000

部署網站

1
hexo deploy (hexo d)

npm 安裝

install hexo-deployer-git(for _config.yml’s type: git)

1
npm install hexo-deployer-git --save
1
npm install hexo-image-link --save

1
![picture 1](hexo/test.png)

設定檔案編輯

_config.yml(for GitHub)

1
2
3
4
deploy:
type: git
repository: 'https://github.com/hot5656/hot5656.github.io.git'
branch: master

_config.yml(for 圖片放於對應的目錄下)

1
post_asset_folder: true

_config.yml(for 網址設定)

1
2
url: https://hot5656.github.io/blog/
root: /blog/

md檔 設定

顯示圖片(含設定寬度)

1
2
3
<div style="width:500px">
{% asset_img pic1.png pic1 %}
</div>