Skip to content

Commit

Permalink
Update output-formats.md (#2036)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwc69151 authored Mar 31, 2023
1 parent 289da56 commit 0988c4a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions content/en/templates/output-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linktitle: Custom Output Formats
description: Hugo can output content in multiple formats, including calendar events, e-book formats, Google AMP, and JSON search indexes, or any custom text format.
date: 2017-03-22
publishdate: 2017-03-22
lastmod: 2019-12-11
lastmod: 2023-03-31
categories: [templates]
keywords: ["amp", "outputs", "rss"]
menu:
Expand Down Expand Up @@ -49,16 +49,16 @@ The above example adds one new media type, `text/enriched`, and changes the suff

**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the media type. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:

```toml
{{< code-toggle file="config" >}}
[mediaTypes]
[mediaTypes."text/html"]
suffixes = ["htm"]
[mediaTypes."text/html"]
suffixes = ["htm"]

# Redefine HTML to update its media type.
[outputFormats]
[outputFormats.HTML]
mediaType = "text/html"
```
[outputFormats.HTML]
mediaType = "text/html"
{{</ code-toggle >}}

**Note** that for the above to work, you also need to add an `outputs` definition in your site config.

Expand Down

0 comments on commit 0988c4a

Please sign in to comment.