--- tags: blog, hexo --- # Hexo 起手式 http://ibruce.info/2013/11/22/hexo-your-blog/?utm_source=tuicool&utm_medium=referral https://chrischen0405.github.io/2018/09/11/post20180911/ ### 前置作業(只需要執行一次) 1. 安裝Node.js: https://nodejs.org/en/ 2. Hexo Git `$ npm install hexo-deployer-git --save` 3. Hexo ``` $ npm install hexo-cli -g ``` ### 初始化Blog(每次開一個blog,都重新執行一次) 1. 建立一個資料夾 2. 初始化部落格: ``` hexo init <你的資料夾名稱> ``` 3. 移動到該資料夾 `cd <你的資料夾名稱>` 4. 安裝相關套件 `npm install` ### 啟動blog server ``` hexo s ``` ### 創建新文章 `hexo new [你的文章名字]` ### 安裝next 主題 ``` $ git clone https://github.com/theme-next/hexo-theme-next themes/next ``` ### 掛載到github 1. 建立一個新的倉庫 2. 新增專案,名稱 ``` <yourname>.github.io ```  3. 至全域設定檔設定 搜尋deploy ``` deploy: type:"" ``` 把你要上傳的位址寫完整 ``` deploy: type: git repository: http://github.com/**yourname/yourname.github.io.git** branch: master ``` 注意 “:” 後需要空一格 粗體的部分取代成你剛設立的位置  4. 安裝hexo-deployer-git ``` npm install hexo-deployer-git --save ``` 若沒有安裝會報錯  5. 執行hexo deploy 推送命令 ``` hexo deploy ```  需要輸入你的git的帳號密碼,驗證你是否可以推送 ### 推送後刪除文章 $ hexo clean # 清除快取檔案和已產生的靜態檔案。 $ hexo d -g # d = deploy, g = generate ### 自訂CSS : _custom> style. https://io-oi.me/tech/hexo-next-optimization/
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up