hexo搭建自己的博客系統

動手搭建基于Hexo的Blog

基本操作

依賴

安裝hexo

mkdir <github-name>.github.io -p
cd <github-name>.github.io
sudo npm install -g hexo-cli

初始化博客框架

hexo init
npm install

初次展現

經過上面簡單的步驟,已經把基本的博客框架給搭建好了.可以查看下效果.

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 #注意, 默認是landscape

這里可配置文件選項較多,請查看文檔

更多配置

提交到git

git push origin master
hexo g
hexo d

原文及效果展現

注意事項

git pushgithub page之后出現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.

這個是要指定下, 可以參考.

  • 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.

這個也比較好解決的.去themes下的landscape刪除README.md文件.

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容