1、配置導航
//進入對應主題的配置文件
//如:blog/themes/next/_config.yml
#找回menu配置項(按照自己的需求添加或修改)
menu:
home: / #首頁
archives: /archives #歸檔頁
#sitemap: /sitemap.xml
#commonweal: /404.html
2、標簽頁
//生成標簽頁
hexo new page tags
//此時blog/source/目錄下會生成 tags/index.md
//配置index.md
---
title: Tagcloud
date: 2017-01-11 15:23:30
type: "tags"
---
//添加標簽頁導航
vim blog/themes/next/_config.yml
#找到menu配置項(按照添加tags)
menu:
home: / #首頁
archives: /archives #歸檔頁
tags: tags #標簽頁
#sitemap: /sitemap.xml
#commonweal: /404.html
PS:文章添加標簽如下:
---
title: Hexo+Github搭建個人Blog
date: 2017-01-11 15:40:26
tags: [Hexo,Github,Blog] #只有1個標簽可用(tags: Hexo)
---
3、404頁
cd blog/source/
//將準備好的404.html頁面放入此目錄
# 404.html
<!DOCTYPE HTML>
<html>
<head>
<title>404 - Flycorn's Blog</title>
<meta name="description" content="404錯誤,頁面不存在!">
<meta http-equiv="content-type" content="text/html;charset=utf-8;"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="robots" content="all" />
<meta name="robots" content="index,follow"/>
</head>
<body>
<script type="text/javascript" src="http://www.qq.com/404/search_children.js" charset="utf-8" homepageurl="/" homepagename="回到Blog"></script>
</body>
</html>
4、分類頁
//生成分類頁
hexo new page categories
//此時blog/source/目錄下會生成 categories/index.md
//配置index.md
---
title: 分類
date: 2017-01-18 12:04:11
type: categories
---
//添加分類頁導航
vim blog/themes/next/_config.yml
#找到menu配置項(按照添加categories)
menu:
home: /
categories: /categories
about: /about
archives: /archives
tags: /tags
#sitemap: /sitemap.xml
#commonweal: /404.html
PS:文章添加分類如下:
---
title: Hexo+Github搭建個人Blog
date: 2017-01-11 15:40:26
tags: [Hexo,Github,Blog] #只有1個標簽可用(tags: Hexo)
categories: 學習筆記
---
5、多說評論模塊
以next主題為例!
1、注冊[多說](http://duoshuo.com/)
2、登錄后在首頁選擇 “我要安裝”。
3、創建站點,填寫表單。多說域名 這一欄填寫的即是你的 duoshuo_shortname
4、創建站點完成后在 站點配置文件 中新增 duoshuo_shortname 字段,值設置成上一步中的值(如:flycorn)。
6、友情鏈接
以next主題為例!
//編輯主題配置
vim blog/themes/next/_config.yml
# 找到 social 選項,配置外鏈
social:
GitHub: https://github.com/flycorn
簡書: http://www.lxweimin.com/u/d3b9df1ce6d9
#配置外鏈圖標
social_icons:
enable: true
# Icon Mappings.
# KeyMapsToSocalItemKey: NameOfTheIconFromFontAwesome
GitHub: github
Twitter: twitter
Weibo: weibo
7、Rss訂閱模塊
以next主題為例!
1、安裝插件
cd blog
npm install hexo-generator-feed
2、編輯站點配置
vim _config.yml
# 配置RSS
feed:
#feed 類型 (atom/rss2)
type: atom
#rss 路徑
path: atom.xml
#在 rss 中最多生成的文章數(0顯示所有)
limit: 0
以上配置完,需執行以下:
#清除緩存
hexo clean
#生成靜態頁
hexo generate
#發布到github
hexo deploy