Go 模板代码检查与格式化工具
djLint 可以检查和格式化 Go 模板。设置 golang 预设,让规则和格式化方式适合这类模板。
Hugo 主题和 Helm chart 同样基于 Go 模板(text/template、html/template),因此也请为它们使用这个预设。
使用命令行
djlint /path/to/templates --profile=golang
或者,使用配置文件
在项目的 pyproject.toml、djlint.toml / .djlint.toml 或 .djlintrc 文件中配置 djLint。
[tool.djlint]
profile = "golang"
profile = "golang"
{ "profile": "golang" }