# Params
> 返回项目配置中定义的自定义参数映射。
- 官方英文原文：https://gohugo.io/methods/site/params/
- 本页规范地址：https://hugozh.cn/methods/site/params/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：SITE.Params
- 返回类型：maps.Params
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
项目配置如下：

```toml
[params]
  subtitle = 'The Best Widgets on Earth'
  copyright-year = '2023'
  [params.author]
    email = 'jsmith@example.org'
    name = 'John Smith'
  [params.layouts]
    rfc_1123 = 'Mon, 02 Jan 2006 15:04:05 MST'
    rfc_3339 = '2006-01-02T15:04:05-07:00'
```

通过[链式](g)调用[标识符](g)来访问自定义参数：

```go-html-template
{{ .Site.Params.subtitle }} → The Best Widgets on Earth
{{ .Site.Params.author.name }} → John Smith

{{ $layout := .Site.Params.layouts.rfc_1123 }}
{{ .Site.Lastmod.Format $layout }} → Tue, 17 Oct 2023 13:21:02 PDT
```

在上面这个模板示例中，每个键都是合法的标识符，例如没有哪个键包含连字符。要访问不是合法标识符的键，请使用 [`index`][] 函数：

```go-html-template
{{ index .Site.Params "copyright-year" }} → 2023
```

[`index`]: /functions/collections/indexfunction/

