hexo添加第三方功能支持

hexo添加第三方插件,可以实现很多功能,如seo优化,生成feed等。

SEO优化

seo优化简单的说如何让搜索引擎收录你的网站。参考此博文

需注意一点的是,因为网站未备案的原因,直接使用http无法访问自己的博客。而hexo中自动生成的sitemap都是默认以http来访问,导致提交sitemap到谷歌的时候,会无法抓取。所以我手动修改了一下sitemap的模板文件。

  • hexo-generator-sitemap

    node_modules\hexo-generator-sitemap\sitemap.xml中,手动加入https://

    1
    <loc>https://{{ post.permalink | uriencode }}</loc>
  • hexo-generator-baidu-sitemap

    node_modules\hexo-generator-baidu-sitemap\baidusitemap.ejs中,手动加入https://

    1
    <loc>https://<%- encodeURI(url + post.path) %></loc>

添加feed

安装feed插件

1
npm install hexo-generator-feed --save

在站点_config.yml文件中添加

1
2
3
4
5
6
7
8
feed:
type: atom
path: atom.xml
limit: 20
hub:
content: true
content_limit: 140
content_limit_delim: ' '

添加评论系统

Valine是一款极简的评论系统,基于leancloud。具体参考此博文

参考链接