代码高亮

2021-01-01

该项为必选置项,map类型,包含站点 highlighting 设置信息

在项目目录 config.toml,可配置该项

配置


1[site.markdown.highlighting]
2state = true
3theme = "github"
4linenumber = true
Notice:
  • 该项所定义内容,在任意模板页均可使用
  • 该项为字典类型,支持配置多个非重名[name]配置项

释义


  1. theme

    设置代码高亮主题颜色

  2. linenumber

    设置代码高亮是否显示行号

举例


1package main
2
3import "fmt"
4
5func main() {
6	fmt.Println("Hello, 世界")
7}