美文网首页
Hexo 升级至 5.0 版

Hexo 升级至 5.0 版

作者: 洗洗睡吧i | 来源:发表于2020-08-05 13:04 被阅读0次

1. 升级 HEXO

  • 打开package.json, 修改 dependencies 项:
    "hexo": "^5.0.0",
  • 更新
npm update

2. 改变一:通过npm安装主题

  • 安装next主题: npm install hexo-theme-next
  • 设置hexo主配置文件:
# _config.yml
theme: next
  • 在根目录新建next主题的配置文件_config.next.yml
# _config.next.yml
scheme: Gemini

footer:
  since: 2015
  icon:
    animated: true

# balabala ... 
  • 然后可以删除原来的主题目录:themes/next

3. 改变二:代码高亮:PrismJS

新增了 PrismJS 代码高亮支持:

# _config.yml
highlight:
  enable: true
  auto_detect: false
  line_number: true
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

试了一下prismjs, 部分代码格式不对, 似乎有bug, 放弃。

相关文章

网友评论

      本文标题:Hexo 升级至 5.0 版

      本文链接:https://www.haomeiwen.com/subject/tktdrktx.html