mirror of https://github.com/gohugoio/hugo
1.0 KiB
1.0 KiB
title | description | categories | keywords | params | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
OutputFormats | Returns a slice of OutputFormat objects, each representing one of the output formats enabled for the given page. |
|
{{% glossary-term "output format" %}}
The OutputFormats
method on a Page
object returns a slice of OutputFormat
objects, each representing one of the output formats enabled for the given page. See details.
Methods
{{% include "/_common/methods/page/output-format-methods.md" %}}
Example
To link to the RSS feed for the current page:
{{ with .OutputFormats.Get "rss" }}
<a href="{{ .RelPermalink }}">RSS Feed</a>
{{ end }}
On the site's home page, Hugo renders this to:
<a href="/index.xml">RSS Feed</a>
Please see the link to output formats section to understand the importance of the construct above.