0%

在github上搭建Hexo Blog

搭建过程

主要过程请参考官方文档:
https://hexo.io/zh-cn/docs/index.html

  • 基于本博客Octopress搭建过程给出迁移方法。

    把 Octopress source/_posts 文件夹内的所有文件转移到 Hexo 的 source/_posts 文件夹,并修改 _config.yml 中的 new_post_name 参数。

    new_post_name: :year-:month-:day-:title.md

    注:octopress博文目录是在blog目录下,而hexo是在根目录下。如需调整为一致地址,_config.yml中更改permalink,在地址头部加入/blog/

  • sitemap站点地图

1、安装插件:
npm install hexo-generator-sitemap –save
npm install hexo-generator-baidu-sitemap –save
2、在博客目录的_config.yml中添加如下代码:

1. # 自动生成sitemap
2. sitemap:
3. path: sitemap.xml
4. baidusitemap:
5. path: baidusitemap.xml

3、hexo编译的时候会自动在根目录生成站点地图

  • 中文乱码
    在文件中写中文内容,发布出来后为乱码,原因是编码不对,将文件另存为“UTF-8”编码的文件即可解决问题。

加密

https://github.com/MikeCoder/hexo-blog-encrypt/issues/16

xmsec