mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 01:37:25 +08:00
Add USE_SERVICE_WORKER setting (#9110)
* Add USE_SERVICE_WORKER setting This will be very useful setting for anyone doing frontend work. Fixes: https://github.com/go-gitea/gitea/issues/9044 * prevent potential syntax error on old browsers
This commit is contained in:

committed by
techknowlogick

parent
cbaa1de9ec
commit
f0aaffeedc
@ -148,6 +148,9 @@ func NewFuncMap() []template.FuncMap {
|
||||
"MetaKeywords": func() string {
|
||||
return setting.UI.Meta.Keywords
|
||||
},
|
||||
"UseServiceWorker": func() bool {
|
||||
return setting.UI.UseServiceWorker
|
||||
},
|
||||
"FilenameIsImage": func(filename string) bool {
|
||||
mimeType := mime.TypeByExtension(filepath.Ext(filename))
|
||||
return strings.HasPrefix(mimeType, "image/")
|
||||
|
Reference in New Issue
Block a user