Hexo 坑
浏览器样式缓存问题
这个其实也不只是 hexo 页面会遇到的问题,所有页面修改样式后都会有样式缓存的问题,解决办法如下:
浏览器端 ctrl(command) + shift + r
手机浏览器同样要清除缓存,如 safari history -> clear all
master 分支中修改样式,然后发布,不是必须提交远程
hexo db.json
db.json 为缓存文件,如果 theme 有修改,请删除 db.json。然后再执行
hexo g
hexo 启动草稿服务
1 | $ hexo g && hexo s --drafts |
hexo deploy 没有反应
检查
_config.yml 中 deploy 配置
访问页面空白
检查
themes
断行,在首页展示缩略信息,该方法能被 hexo 更好识别
1 | <!--more--> |
1 | auto_excerpt: |
ERROR - No layout: index.html
1 | $ hexo s |
解决办法:
1 | $ git clone https://github.com/zhwangart/hexo-theme-ocean.git themes/ocean |
Modify theme setting in _config.yml to ocean
theme: ocean
ERROR - 发布到 git 服务器访问出现空白页或无主题样式
原因是发布到 github 上的项目名称要与个人github的用户名一致,且加后缀 .github.io,如 ‘helenzhanglp.github.io’
ERROR - 博客中添加 gitalk
## Error Error: Not Found. ##
解决办法:
1 | gitalk: |
ERROR - theme 样式修改,先需要先提交至 github,再 deploy
Error: Spawn failed
fatal: unable to access ‘https://github.com/HelenZhangLP/helenzhanglp.github.io.git/': Received HTTP code 502 from
proxy after CONNECT
FATAL Something’s wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
解决办法:
_config.yml 中 修改 deploy,https 链接换成 ssh
deploy:
type: git
repo: git@github.com:/.github.io.git
hexo 中加入 sequence diagram,安装 hexo-filter-sequence 后不显示
1 | sequence-diagram.js:792 Uncaught ReferenceError: Raphael is not defined |
解决办法:
临时在头部加入
1 | <% if(config.sequence) {%> |