mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
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
This commit is contained in:
@@ -208,12 +208,7 @@ func (r *Spec) newGenericResourceWithBase(
|
||||
baseFilename = helpers.ToSlashTrimLeading(baseFilename)
|
||||
fpath, fname := path.Split(baseFilename)
|
||||
|
||||
var resourceType string
|
||||
if mediaType.MainType == "image" {
|
||||
resourceType = mediaType.MainType
|
||||
} else {
|
||||
resourceType = mediaType.SubType
|
||||
}
|
||||
resourceType := mediaType.MainType
|
||||
|
||||
pathDescriptor := &resourcePathDescriptor{
|
||||
baseTargetPathDirs: helpers.UniqueStringsReuse(targetPathBaseDirs),
|
||||
|
Reference in New Issue
Block a user