Improve suffix redefinition example

This commit is contained in:
Bjørn Erik Pedersen 2017-11-23 13:54:32 +01:00
parent c9997839ec
commit de2ee0fe05
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F

View File

@ -37,8 +37,6 @@ This is the full set of built-in media types in Hugo:
To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
Example in `config.toml`:
```
[mediaTypes]
[mediaTypes."text/enriched"]
@ -49,6 +47,18 @@ Example in `config.toml`:
The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type.
**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 output format. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
```toml
[mediaTypes]
[mediaTypes."text/html"]
suffix = "htm"
# Redefine HTML to update its media type.
[outputFormats.HTML]
mediaType = "text/html"
```
## Output Formats
Given a media type and some additional configuration, you get an `Output Format`: