aboutsummaryrefslogtreecommitdiffhomepage
path: root/media
diff options
context:
space:
mode:
authorNicolas Martignoni <[email protected]>2019-10-16 15:10:32 +0200
committerBjørn Erik Pedersen <[email protected]>2019-10-16 17:16:14 +0200
commit689f647baf96af078186f0cdc45199f7d0995d22 (patch)
treea521dff3f3eb695a826c10b7b493e77f55b01395 /media
parent46cafdbaca13866f32db04c0cc28374e30ec5914 (diff)
downloadhugo-689f647baf96af078186f0cdc45199f7d0995d22.tar.gz
hugo-689f647baf96af078186f0cdc45199f7d0995d22.zip
media: Add common video media types
- See https://discourse.gohugo.io/t/resources-bytype-for-video-files/21285
Diffstat (limited to 'media')
-rw-r--r--media/mediaType.go14
-rw-r--r--media/mediaType_test.go2
2 files changed, 15 insertions, 1 deletions
diff --git a/media/mediaType.go b/media/mediaType.go
index b28ca0d8f..05a37921d 100644
--- a/media/mediaType.go
+++ b/media/mediaType.go
@@ -145,6 +145,14 @@ var (
TIFFType = Type{MainType: "image", SubType: "tiff", Suffixes: []string{"tif", "tiff"}, Delimiter: defaultDelimiter}
BMPType = Type{MainType: "image", SubType: "bmp", Suffixes: []string{"bmp"}, Delimiter: defaultDelimiter}
+ // Common video types
+ AVIType = Type{MainType: "video", SubType: "x-msvideo", Suffixes: []string{"avi"}, Delimiter: defaultDelimiter}
+ MPEGType = Type{MainType: "video", SubType: "mpeg", Suffixes: []string{"mpg", "mpeg"}, Delimiter: defaultDelimiter}
+ MP4Type = Type{MainType: "video", SubType: "mp4", Suffixes: []string{"mp4"}, Delimiter: defaultDelimiter}
+ OGGType = Type{MainType: "video", SubType: "ogg", Suffixes: []string{"ogv"}, Delimiter: defaultDelimiter}
+ WEBMType = Type{MainType: "video", SubType: "webm", Suffixes: []string{"webm"}, Delimiter: defaultDelimiter}
+ GPPType = Type{MainType: "video", SubType: "3gpp", Suffixes: []string{"3gpp", "3gp"}, Delimiter: defaultDelimiter}
+
OctetType = Type{MainType: "application", SubType: "octet-stream"}
)
@@ -167,6 +175,12 @@ var DefaultTypes = Types{
TOMLType,
PNGType,
JPGType,
+ AVIType,
+ MPEGType,
+ MP4Type,
+ OGGType,
+ WEBMType,
+ GPPType,
}
func init() {
diff --git a/media/mediaType_test.go b/media/mediaType_test.go
index 4f00b0671..f18fd90bb 100644
--- a/media/mediaType_test.go
+++ b/media/mediaType_test.go
@@ -58,7 +58,7 @@ func TestDefaultTypes(t *testing.T) {
}
- c.Assert(len(DefaultTypes), qt.Equals, 17)
+ c.Assert(len(DefaultTypes), qt.Equals, 23)
}