Hexo-nexT博客搭建-nexT主题配置-代码高亮

推荐先阅读【2022教程全】Hexo博客 + nexT主题

先看效果

image-20220810161144551

博客下配置文件../blog/_config.yml设置为true

highlight:
enable: true

主题下配置文件../blog/themes/hexo-theme-next/_config.yml 配置修改为:

codeblock:
# Code Highlight theme
# Available values: normal | night | night eighties | night blue | night bright | solarized | solarized dark | galactic
# See: https://github.com/chriskempson/tomorrow-theme
highlight_theme: night eighties
# Add copy button on codeblock
copy_button:
enable: true
# Show text copy result.
show_result: true
# Available values: default | flat | mac
style: default