auroral-ui / hexo-theme-aurora

🏳️‍🌈 Futuristic auroral Hexo theme.
https://blog.bennyxguo.com
MIT License
1.37k stars 217 forks source link

代码高亮未启用 #367

Closed Theo-Messi closed 11 months ago

Theo-Messi commented 12 months ago

代码高亮好像没有启用(之前v2.4.3好像也没有,可能是我设置的问题)

```css
[type='radio'] {
  margin: 20px 0px 20px 0px;
}

<img src=https://cdn.jsdelivr.net/gh/vanhiupun/pic@1.0/img/202309131340137.png width=60% />

```yaml
### _config.aurora.yml
shiki:
  enable: true
  theme: vitesse-dark
  backgroundColor: '#1a1a1a'
### _config.yml
highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: false
  line_number: true
  tab_replace: false
bennyxguo commented 12 months ago

试试把陪护改成这样:

### _config.aurora.yml
shiki:
  enable: true
  theme: vitesse-dark
  backgroundColor: '#1a1a1a'

### _config.yml
highlight:
  enable: false
prismjs:
  enable: false

确保你更新了 hexo-plugin-aurora 到版本 v1.8.2+, 可以跑一下这个:

npm install hexo-theme-aurora@latest hexo-plugin-aurora@latest

然后一定要跑这个命令:

hexo clean && hexo g
Theo-Messi commented 11 months ago

当我将 shiki设置为enable: false prismjs设置为enable: true

重新运行

hexo clean && hexo g

代码高亮依旧未启用,因此我怀疑是其他问题

Theo-Messi commented 11 months ago

找到原因了,当我修改package.json,将hexo版本设置为6.3.0时,重新生成代码高亮就回来了

...
  "hexo": {
    "version": "6.3.0"
  },
  "dependencies": {
    "hexo": "^6.3.0",
...
bennyxguo commented 11 months ago

当前脚本没有支持 7.0,而且 7.0 也是预览版呢。先用 6.x 就好。