diff options
author | SohnyBohny <sohny.bean@streber24.de> | 2018-11-27 16:18:26 +0100 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-11-27 10:18:26 -0500 |
commit | 294904321cb6de535237a6a156d5c4ec462bc117 (patch) | |
tree | 3b4c7bc1748a5b64de29d6efca37705b3071fc2b /modules/templates/static.go | |
parent | e09fe487734238708c2f9fc7c47dbb2132250400 (diff) | |
download | gitea-294904321cb6de535237a6a156d5c4ec462bc117.tar.gz gitea-294904321cb6de535237a6a156d5c4ec462bc117.zip |
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
Diffstat (limited to 'modules/templates/static.go')
-rw-r--r-- | modules/templates/static.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/templates/static.go b/modules/templates/static.go index 6fd4d245e1..e69e1cae48 100644 --- a/modules/templates/static.go +++ b/modules/templates/static.go @@ -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() { |