npm install -g hexo
安裝clihexo init
初始化hexonpm install
安裝依賴git clone https://github.com/iissnan/hexo-theme-next themes/next
(next爲主題名字),來得到更多主題更改_config.yml文件更換主題,另外注意如下配置項git
theme: next deploy: type: git repo: https://github.com/Github暱稱/Github暱稱.github.io.git branch: master
設置文章title,在md文件中以下寫github
--- title: 個人博客 ---
hexo deploy -g
或者 hexo g
生成博客頁面hexo server -g
或者 hexo s
本地服務器查看npm
Github暱稱.github.io
npm install hexo-deployer-git --save
先吐槽一下這個title,意思就是我換電腦了,從公司換到家裏或者哪天出去旅遊在網吧。。。忽然想寫博客了有木有,怎麼辦,好着急。。。服務器
解決方案: 使用github分支。一個分支用來存放Hexo生成的網站原始的文件,另外一個分支用來存放生成的靜態網頁。hexo
本地博客根文件夾路徑下執行如下命令:工具
git init git checkout -b hexo git remote add origin https://github.com/Github暱稱/Github暱稱.github.io.git git add . git commit -m "提交說明" git push origin hexo
git clone -b hexo https://github.com/Github暱稱/Github暱稱.github.io.git
,而後再博客項目執行 npm install
便可安裝好博客環境.md
文件放到 Hexo\source\_posts\
路徑下生成新的博客並部署:post
hexo g (生成),hexo d (部署),可合併爲 hexo d -g測試
上面一步只是生成博客頁面而且發佈了,不要忘記把你寫的 XX.md
文件 add
上傳到你的github倉庫hexo分支中進行備份!網站
fatal: HttpRequestException encountered
解決方法: