MediaType
Returns the media type of the given output format.
Syntax
OUTPUTFORMAT.MediaType
Returns
media.Type
To use this method you must first select a specific output format from a page’s OutputFormats collection using the Get or Canonical methods.
{{ with .Site.Home.OutputFormats.Get "rss" }}
{{ with .MediaType }}
{{ .Type }} → application/rss+xml
{{ .MainType }} → application
{{ .SubType }} → rss
{{ end }}
{{ end }}Methods
MainType
(string) Returns the main type of the output format’s media type.
SubType
(string) Returns the subtype of the current format’s media type.
Type
(string) Returns the the current format’s media type.
Last updated:
February 6, 2026
:
content: Define canonical output format and default site (9b33bb5fa)
Improve this page