Hexo
博客需要修改两个配置文件:
- 站点的配置文件:
/_config.yml
- 模板的配置文件:
/themes/next/_config.yml
以下内容将主要围绕这两个文件展开。
安装 NexT
- 下载
hexo-theme-next
: NexT - 修改站点配置文件:
language: zh-Hans
url: http://yumuzi.github.io/
theme: next
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: git@github.com:yumuzi/yumuzi.github.io.git
branch: master
配置 NexT
设置侧边栏头像
在站点配置文件任意位置添加如下代码,并将图片放置在 /source/uploads/
文件夹下。
avatar: /uploads/avatar.jpg
设置评论 duoshuo
在站点配置文件中添加如下代码,并参考 设置多说 DISQUS
duoshuo_shortname: liyanjie
添加友情链接
将链接添加到站点配置文件中。
# Social links
social:
GitHub: https://github.com/yumuzi
BitBucket: https://bitbucket.org/liyanjie/
#Twitter: https://twitter.com/iissnan
#Weibo: http://weibo.com/iissnan
#DouBan: http://douban.com/people/iissnan
ZhiHu: https://www.zhihu.com/people/dong-cheng-xi-jiu-46
TRISK: http://www.sh-trisk.com/
RiskVisual: http://139.196.177.141/VMonitor/Auth/login.html
TJ-Library: http://www.lib.tongji.edu.cn/site/tongji/index.html
GoogleScholar: https://scholar.google.com.hk/
BaiDuScholar: http://xueshu.baidu.com/
LiaoXuefeng: http://www.liaoxuefeng.com/
ESET: http://bbs.kafan.cn/thread-1466549-1-1.html
添加 Google Webmaster tools 验证
参考: 添加 Google Webmaster tools 验证
在站点配置文件中添加如下代码:
# Google Webmaster tools verification setting
# See: https://www.google.com/webmasters/
google_site_verification: W8hBJvI6x2_L0qJXcRUxwJbebxd87EQJkLDGRjRslzs
添加 Google Baidu 统计
参考:
# Google Analytics
# Google分析ID
google_analytics: UA-80055069-1
# 百度分析ID
baidu_analytics: c09a5ad5b8a33a8dca67eca63cc05ca5
添加站点地图
参考:
使用插件生成站点地图,代码如下:
$ npm install hexo-generator-sitemap --save
$ npm install hexo-generator-baidu-sitemap --save
并在站点配置文件中添加如下代码:
sitemap:
path: sitemap.xml
baidumap:
path: baidusitemap.xml
添加 RSS 订阅
参考:Hexo添加Rss订阅
安装 RSS
插件:
$ npm install hexo-generator-feed --save
在站点配置文件中添加如下代码:
# RSS 订阅支持
# Feed Atom
feed:
type: atom
path: atom.xml
limit: 20
hub:
添加站内搜索
参考:Swiftype站内搜索
自定义站内搜索
参考:自定义站内搜索
阅读次数
# Show number of visitors to each article.
# You can visit https://leancloud.cn get AppID and AppKey.
leancloud_visitors:
enable: true
app_id: zLSdflMuUY1ECQoMfs2yesmi-gzGzoHsz
app_key: vHXMGspVWONNGTitY8143H6v
未完待续…
没有评论:
发表评论