anzhiyu配置--代码配置

修改 anzhiyu_config.yaml

1
2
3
4
5
6
highlight_theme: mac light #  darker / pale night / light / ocean / mac / mac light / false
highlight_copy: true # copy button
highlight_lang: true # show the code language
highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
highlight_height_limit: 330 # unit: px
code_word_wrap: true

说明:

主题渲染

1
highlight_theme: mac light #  darker / pale night / light /

代码粘贴

1
highlight_copy: true # copy button

代码框展开/关闭

1
highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button

代码自动换行

1
code_word_wrap: true

如果你是使用 highlight 渲染,需要找到你站点的 Hexo 配置文件_config.yml,将 line_number 改成 false:

1
2
3
4
5
highlight:
enable: true
line_number: false # <- 改这里
auto_detect: false
tab_replace:

代码高度设置:超过部分会隐藏,默认330

1
highlight_height_limit: 330 # unit: px

展示代码语言

1
highlight_lang: true # show the code language