github hexo博客优化日志

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hyb612/article/details/88104012

前言

原文地址hexo博客优化日志

由于各种原因,网站会有各种变化以及配置的增加,以日志记下改动。

搭建教程和常见问题

2019年2月27日更新

优化首页标题

修改next主题配置文件,将index_with_subtitle改为true,这样网站的标题将会由主标题和子标题组成。
这样标题就变成了网站名称-网站描述的格式。

2019年1月31日更新

hexo博客seo

1.增加页面关键字,修改next主题配置文件中的keywords:

keywords: "C语言,Cpp,Linux,Go,Python,算法"

修改版权声明信息

修改next主题下的language/zh-Hans.yml中的版权声明相关内容即可。

2019年1月28日更新

解决hexo 公式渲染不完整的问题

原来的渲染引擎有问题,需要卸载,并重新安装完好的MathJax渲染引擎:

npm uninstall hexo-renderer-marked --save
npm install hexo-renderer-kramed --save

2018年12月13日更新

增加google站点地图

安装插件:

npm install hexo-generator-sitemap --save

特别注意,配置文件中的url需要填写成你自己网站的全地址,例如,我的url地址是https://www.yanbinghu.com

2018年12月11日更新

解决卜算子计数脚本失效问题

打开next主题next/layout/_third-party/analytics/busuanzi-counter.swig 中卜算子脚本地址
修改为:https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js

2018年9月5日更新

博客内容免密部署

方法:
本地生成ssh key,并部署到github或coding上去,并且修改_config.yml deploy的repository属性

  #repository: https://github.com/yonghuming/yonghuming.github.io.git 
  repository: [email protected]:yonghuming/yonghuming.github.io.git #yonghuming为自己的github账户名

让百度收录网站地址

可能是由于github 禁止了对百度的github pages进行抓取,因此网站无法被百度收录。
解决方法:将博客同时部署到coding上,并且映射域名,国内网络访问时,访问coding pages,这样就可以使得百度能够抓取网站内容,网站也会被百度收录。

强制https访问网站

github pages默认情况下是http访问的,有时候http会被浏览器标识为不安全,因此,需要更改github pages的设置,强制https访问网站。
设置方法:进入github pages项目–>setting–>勾选Enfoce HTTPS

2018年9月4日更新

添加微信公众号

wechat_subscriber:
  enabled: true
  qcode: /pictures/qrcode.jpg   #二维码路径
  description: 欢迎关注个人微信公众号#描述

2018年6月2日更新

将jiathis分享更换为百度分享

由于jiathis分享已停止服务,因此将其更换为百度分享。

文章底部添加版权声明

将配置文件的post_copyright的enable选项设为true即可。

2017年10月22日更新

修改字体

修改字体大小,可通过修改/source/css/_variables/base.styl
中的font-size-base,这是修改除标题以外的其他内容字体大小。
code-font-size修改代码字体大小。
font-family-base 修改字体

2017年10月21日更新

修改链接样式

修改文件source\css_common\components\post\post.styl
增加内容

.post-body p a{
  color: #0593d3;
  border-bottom: none;
  border-bottom: 1px solid #0593d3;
  &:hover {
    color: #fc6423;
    border-bottom: none;
    border-bottom: 1px solid #fc6423;
  }
}

增加gitment和gitalk评论系统

具体内容见文章hexo 博客next主题集成gitment或者gitalk评论系统

修改tag标签

修改layout/_macro/post.swig
搜索 rel=“tag”>#,将 # 换成

2017年7月29日更新

添加RSS订阅

npm install hexo-generator-feed --save

增加友情链接

更新关于我页面

文章添加更新日期

2017年7月28日更新

1.添加来必力评论系统

由于网易跟帖停止服务,将跟帖评论系统更换为来必力评论系统。

在https://livere.com/注册并添加你的网站,同时
修改next主题配置文件

# Support for LiveRe comments system.
# You can get your uid from https://livere.com/insight/myCode (General web site)
livere_uid: ××××××××××××××××××

目前来看,来必力支持的第三方登录比较多,包括微信,qq,github,领英,豆瓣,google+,facebook等主流社交账号登录。

2.添加打赏功能

修改配置文件

reward_comment: 坚持原创技术分享,您的支持将鼓励我继续创作!
wechatpay: /wechatpay.jpg
alipay: /alipay.jpg

wechatpay.jpg 和alipay.jpg分别是微信和支付宝的收款二维码。可放在hexo的resource目录下。

3.添加文章的字数统计和阅读时长统计

修改配置文件

# Post wordcount display settings
# Dependencies: https://github.com/willin/hexo-wordcount
post_wordcount:
  item_text: true
  wordcount: true
  min2read: true

另外,在hexo根目录下执行命令

npm i --save hexo-wordcount

安装成功后即可。

4添加站内搜索

 安装hexo-generator-search

 npm install hexo-generator-searchdb --save

在站点的_config.yml中添加

search:
path: search.xml
field: post
format: html
limit: 10000

同时在next主题中开启local search

5.问题

搭建教程和常见问题

原文地址:github hexo博客优化日志

本文作者: 守望
本文链接: https://www.yanbinghu.com/2017/07/28/56337.html
版权声明: 本文为原创文章,版权归守望所有,并采用 CC BY-NC-SA 3.0 许可协议。转载请联系本人!

猜你喜欢

转载自blog.csdn.net/hyb612/article/details/88104012