# strings.Title
> 返回给定字符串，并转换为标题式大小写。
- 官方英文原文：https://gohugo.io/functions/strings/title/
- 本页规范地址：https://hugozh.cn/functions/strings/title/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：strings.Title STRING
- 返回类型：string
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
```go-html-template
{{ title "table of contents (TOC)" }} → Table of Contents (TOC)
```

默认情况下，Hugo 遵循 [Associated Press Stylebook][] 发布的大小写规则。如果你更希望采用以下某种方式，请修改[项目配置][]：

- 遵循 [Chicago Manual of Style][] 发布的大小写规则
- 每个单词的首字母都大写
- 只把第一个单词的首字母大写
- 关闭 `title` 函数的效果

如果主题使用了 `title` 函数，而你更愿意按需手动处理大小写，最后一种选项会很有用。

[Associated Press Stylebook]: https://www.apstylebook.com/
[Chicago Manual of Style]: https://www.chicagomanualofstyle.org/home.html
[project configuration]: /configuration/all/#title-case-style

