mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-15 16:27:32 -04:00
Improve suffix redefinition example
This commit is contained in:
parent
c9997839ec
commit
de2ee0fe05
@ -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`:
|
||||
|
Loading…
x
Reference in New Issue
Block a user