mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -3,20 +3,19 @@ title: AlternativeOutputFormats
|
||||
description: Returns a slice of OutputFormat objects, excluding the current output format, each representing one of the output formats enabled for the given page.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- methods/page/OutputFormats
|
||||
returnType: page.OutputFormats
|
||||
signatures: [PAGE.AlternativeOutputFormats]
|
||||
params:
|
||||
functions_and_methods:
|
||||
returnType: page.OutputFormats
|
||||
signatures: [PAGE.AlternativeOutputFormats]
|
||||
---
|
||||
|
||||
{{% glossary-term "output format" %}}
|
||||
|
||||
The `AlternativeOutputFormats` method on a `Page` object returns a slice of `OutputFormat` objects, excluding the current output format, each representing one of the output formats enabled for the given page.. See [details](/templates/output-formats/).
|
||||
The `AlternativeOutputFormats` method on a `Page` object returns a slice of `OutputFormat` objects, excluding the current output format, each representing one of the output formats enabled for the given page. See [details](/configuration/output-formats/).
|
||||
|
||||
## Methods
|
||||
|
||||
{{% include "methods/page/_common/output-format-methods.md" %}}
|
||||
{{% include "/_common/methods/page/output-format-methods.md" %}}
|
||||
|
||||
## Example
|
||||
|
||||
@@ -29,7 +28,7 @@ Generate a `link` element in the `<head>` of each page for each of the alternati
|
||||
{{ if .IsHome }}
|
||||
{{ $title = site.Title }}
|
||||
{{ end }}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ range .AlternativeOutputFormats }}
|
||||
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink $title | safeHTML }}
|
||||
{{ end }}
|
||||
...
|
||||
|
Reference in New Issue
Block a user