# AlternativeOutputFormats
> 返回 OutputFormat 对象切片，其中不含当前输出格式，每项代表该页面启用的一个输出格式。
- 官方英文原文：https://gohugo.io/methods/page/alternativeoutputformats/
- 本页规范地址：https://hugozh.cn/methods/page/alternativeoutputformats/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：PAGE.AlternativeOutputFormats
- 返回类型：page.OutputFormats
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
[输出格式（output format）](/quick-reference/glossary/output-format/)

`Page` 对象上的 `AlternativeOutputFormats` 方法返回一个 `OutputFormat` 对象切片，其中不包含当前输出格式，每一项代表给定页面启用的一个输出格式。详见[说明][]。

例如，为每个备选输出格式各生成一个 `link` 元素：

```go-html-template
{{ range .AlternativeOutputFormats }}
  {{ printf "<link rel=%q type=%q href=%q>" .Rel .MediaType.Type .Permalink | safeHTML }}
{{ end }}
```

Hugo 渲染出的结果大致如下：

```html
<link rel="alternate" type="application/rss+xml" href="https://example.org/index.xml">
<link rel="alternate" type="application/json" href="https://example.org/index.json">
```

[说明]: /configuration/output-formats/

