mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
media: support application/manifest+json
The standard file extension for Web App Manifest files is ".webmanifest". This commit allows Hugo to recognize .webmanifest files as "application/manifest+json" files and to minify them using its JSON minifier. The .webmanifest file extension is recommended in the w3c spec to simplify media type registration: https://www.w3.org/TR/appmanifest/#media-type-registration Webhint docs are also relevant: https://webhint.io/docs/user-guide/hints/hint-manifest-file-extension/ Closes #8624
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
402da3f8f3
commit
02f31897b4
@@ -166,13 +166,14 @@ var (
|
||||
TSXType = newMediaType("text", "tsx", []string{"tsx"})
|
||||
JSXType = newMediaType("text", "jsx", []string{"jsx"})
|
||||
|
||||
JSONType = newMediaType("application", "json", []string{"json"})
|
||||
RSSType = newMediaTypeWithMimeSuffix("application", "rss", "xml", []string{"xml"})
|
||||
XMLType = newMediaType("application", "xml", []string{"xml"})
|
||||
SVGType = newMediaTypeWithMimeSuffix("image", "svg", "xml", []string{"svg"})
|
||||
TextType = newMediaType("text", "plain", []string{"txt"})
|
||||
TOMLType = newMediaType("application", "toml", []string{"toml"})
|
||||
YAMLType = newMediaType("application", "yaml", []string{"yaml", "yml"})
|
||||
JSONType = newMediaType("application", "json", []string{"json"})
|
||||
WebAppManifestType = newMediaTypeWithMimeSuffix("application", "manifest", "json", []string{"webmanifest"})
|
||||
RSSType = newMediaTypeWithMimeSuffix("application", "rss", "xml", []string{"xml"})
|
||||
XMLType = newMediaType("application", "xml", []string{"xml"})
|
||||
SVGType = newMediaTypeWithMimeSuffix("image", "svg", "xml", []string{"svg"})
|
||||
TextType = newMediaType("text", "plain", []string{"txt"})
|
||||
TOMLType = newMediaType("application", "toml", []string{"toml"})
|
||||
YAMLType = newMediaType("application", "yaml", []string{"yaml", "yml"})
|
||||
|
||||
// Common image types
|
||||
PNGType = newMediaType("image", "png", []string{"png"})
|
||||
@@ -206,6 +207,7 @@ var DefaultTypes = Types{
|
||||
TSXType,
|
||||
JSXType,
|
||||
JSONType,
|
||||
WebAppManifestType,
|
||||
RSSType,
|
||||
XMLType,
|
||||
SVGType,
|
||||
|
Reference in New Issue
Block a user