哈哈,后来使用Next主题了,不适用啦,从新将现有博客系统的内容更新了一遍。2019年04月16日19:19:15
参考文章:
初始化hexo
1 | npm install hexo-cli -g |
更换主题
- fork大道至简主题的仓库
克隆《大道至简》的主题
1
git clone https://github.com/sky0504/maupassant-hexo.git themes/maupassant
修改配置,启用主题
vim _config.yml(将theme: landscape更改为theme: maupassant)- 修改语言
vim _config.yml(更改language:为language: zh-CN)
添加评论系统
- 注册Oauth Application
- 查看注册应用的id、secret等信息
- 修改配置文件
vim _config.yml,修改gitment的有关配置信息 修改主题文件
themes/maupassant/layout/_partial/comments.pug,在gitment初始化时添加一行id: '#{page.date}',,整体如下所示:1
2
3
4
5
6
7
8
9var gitment = new Gitment({
id: '#{page.date}',
owner: '#{theme.gitment.owner}',
repo: '#{theme.gitment.repo}',
oauth: {
client_id: '#{theme.gitment.client_id}',
client_secret: '#{theme.gitment.client_secret}',
},
})需要评论的文章,第一次点击
initialize comments按钮,然后在下边的评论框填写评论即可
部署到GitHub上
修改配置
_config.yml中的deploy1
2
3
4deploy:
type: git
repo: https://github.com/sky0504/sky0504.github.io.git
branch: master创建文件
vim source/CNAME,写入一行sky.mafeifei.cn- 打开
https://github.com/sky0504/sky0504.github.io.git的设置,设置Custom domain为sky.mafeifei.cn - 修改域名解析,添加记录类型为
CNAME的一条记录,指向sky0504.github.io
添加备案信息
- 公安部注册备案略
- 下载备案图标到hexo的source目录下
vim themes/maupassant/layout/_partial/footer.pug在该文件最后添加备案图标和备案号信息代码1
2
3
4
5p 浙ICP备16006348号 |
|
img(src="/images/ba.png")
|
a(rel='nofollow', target='_blank', href='http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33010302001929') 公安机关备案33010302001929号