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

---
用位置参数调用短代码时，`Params` 方法返回一个切片。

```md {file="content/about.md"}
```

```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ index .Params 0 }} → Hello
{{ index .Params 1 }} → world
```

用命名参数调用短代码时，`Params` 方法返回一个映射。

```md {file="content/about.md"}
```

```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ .Params.greeting }} → Hello
{{ .Params.name }} → world
```

