動(dòng)手搭建基于Hexo的Blog
基本操作
依賴
- node的依賴.
git
安裝hexo
mkdir <github-name>.github.io -p
cd <github-name>.github.io
sudo npm install -g hexo-cli
初始化博客框架
hexo init
npm install
初次展現(xiàn)
經(jīng)過上面簡單的步驟,已經(jīng)把基本的博客框架給搭建好了.可以查看下效果.
hexo s
然后瀏覽器輸入 localhost:4000
可以查看下基本的效果.
不過,這不是我想要的.
美化操作
主題選擇
下載主題到themes
git clone https://github.com/iissnan/hexo-theme-next themes/next
這樣就把主題搞定了.不過要配置下.在<github-name.github.io>
的_config.yml
中找到theme
.
theme: next #注意, 默認(rèn)是landscape
這里可配置文件選項(xiàng)較多,請(qǐng)查看文檔
更多配置
提交到git
git push origin master
hexo g
hexo d
注意事項(xiàng)
git push
到github page
之后出現(xiàn)404.郵件反饋:
- First
The page build completed successfully, but returned the following warning for the `master` branch:
You are attempting to use a Jekyll theme, "next", which is not supported by GitHub Pages. Please visit https://pages.github.com/themes/ for a list of supported themes. If you are using the "theme" configuration variable for something other than a Jekyll theme, we recommend you rename this variable throughout your site. For more information, see https://help.github.com/articles/adding-a-jekyll-theme-to-your-github-pages-site/.
For information on troubleshooting Jekyll see:
https://help.github.com/articles/troubleshooting-jekyll-builds
If you have any questions you can contact us by replying to this email.
這個(gè)是要指定下, 可以參考.
- Second
The page build failed for the `master` branch with the following error:
The tag `fancybox` on line 77 in `themes/landscape/README.md` is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error/.
For information on troubleshooting Jekyll see:
https://help.github.com/articles/troubleshooting-jekyll-builds
If you have any questions you can contact us by replying to this email.
這個(gè)也比較好解決的.去themes
下的landscape
刪除README.md
文件.