mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +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
@@ -78,7 +78,7 @@ func New(mediaTypes media.Types, outputFormats output.Formats, cfg config.Provid
|
||||
}
|
||||
if !conf.DisableJSON {
|
||||
addMinifier(m, mediaTypes, "json", &conf.Tdewolff.JSON)
|
||||
m.AddRegexp(regexp.MustCompile(`^(application|text)/(x-|ld\+)?json$`), &conf.Tdewolff.JSON)
|
||||
m.AddRegexp(regexp.MustCompile(`^(application|text)/(x-|(ld|manifest)\+)?json$`), &conf.Tdewolff.JSON)
|
||||
}
|
||||
if !conf.DisableSVG {
|
||||
addMinifier(m, mediaTypes, "svg", &conf.Tdewolff.SVG)
|
||||
|
Reference in New Issue
Block a user