From de2ee0fe055a079a6c70780ed1465a053af9e9a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 23 Nov 2017 13:54:32 +0100 Subject: [PATCH] Improve suffix redefinition example --- content/templates/output-formats.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/content/templates/output-formats.md b/content/templates/output-formats.md index e044ce21a..1448a45ec 100644 --- a/content/templates/output-formats.md +++ b/content/templates/output-formats.md @@ -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`: