Create Progressive Web App (#4730)

* Create manifest and serviceworker

* Create templates and add AppSubUrl

* Add JSRenderer

* fix ctx type

* Add JSRenderer to static.go

* Complete adding {{AppSubUrl}}

* Add more fonts to urlsToCache

* Add 512px and 192px icons

* Hardcode font MD5

* Default theme doesn't have a specific CSS file
This commit is contained in:
SohnyBohny 2018-11-27 16:18:26 +01:00 committed by techknowlogick
parent e09fe48773
commit 294904321c
9 changed files with 152 additions and 0 deletions

View file

@ -45,6 +45,18 @@ func JSONRenderer() macaron.Handler {
})
}
// JSRenderer implements the macaron handler for serving JS templates.
func JSRenderer() macaron.Handler {
return macaron.Renderer(macaron.RenderOptions{
Funcs: NewFuncMap(),
Directory: path.Join(setting.StaticRootPath, "templates"),
AppendDirectories: []string{
path.Join(setting.CustomPath, "templates"),
},
HTMLContentType: "application/javascript",
})
}
// Mailer provides the templates required for sending notification mails.
func Mailer() *template.Template {
for _, funcs := range NewFuncMap() {

View file

@ -129,6 +129,15 @@ func JSONRenderer() macaron.Handler {
})
}
// JSRenderer implements the macaron handler for serving JS templates.
func JSRenderer() macaron.Handler {
return macaron.Renderer(macaron.RenderOptions{
Funcs: NewFuncMap(),
TemplateFileSystem: NewTemplateFileSystem(),
HTMLContentType: "application/javascript",
})
}
// Mailer provides the templates required for sending notification mails.
func Mailer() *template.Template {
for _, funcs := range NewFuncMap() {