From 75694d90408df6226d948d48079ea730c09b0469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 17 Dec 2020 09:33:26 +0100 Subject: [PATCH] Fix Resource.ResourceType so it always returns MIME's main type The one exception being for the Page, which does not have a MIME type, in which you will get the value `page`. Fixes #8052 --- content/en/content-management/page-resources.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/en/content-management/page-resources.md b/content/en/content-management/page-resources.md index 75c40ce6e..bdc73a7c3 100644 --- a/content/en/content-management/page-resources.md +++ b/content/en/content-management/page-resources.md @@ -21,7 +21,9 @@ the lowest page they are bundled with, and simple which names does not contain ` ## Properties ResourceType -: The main type of the resource. For example, a file of MIME type `image/jpeg` has the ResourceType `image`. +: The main type of the resource's [Media Type](/templates/output-formats/#media-types). For example, a file of MIME type `image/jpeg` has the ResourceType `image`. A `Page` will have `ResourceType` with value `page`. + +{{< new-in "0.80.0" >}} Note that we in Hugo `v0.80.0` fixed a bug where non-image resources (e.g. video) would return the MIME sub type, e.g. `json`. Name : Default value is the filename (relative to the owning page). Can be set in front matter.