mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
media: Add common video media types
- See https://discourse.gohugo.io/t/resources-bytype-for-video-files/21285
This commit is contained in:
parent
46cafdbaca
commit
689f647baf
2 changed files with 15 additions and 1 deletions
|
@ -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() {
|
||||
|
|
|
@ -58,7 +58,7 @@ func TestDefaultTypes(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
c.Assert(len(DefaultTypes), qt.Equals, 17)
|
||||
c.Assert(len(DefaultTypes), qt.Equals, 23)
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue