diff options
Diffstat (limited to 'templates/base/head.tmpl')
-rw-r--r-- | templates/base/head.tmpl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index bb6a8a981b..47c0d6b473 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -5,6 +5,23 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title> + <link rel="manifest" href="{{AppSubUrl}}/manifest.json"> + + <script> + if ('serviceWorker' in navigator) { + window.addEventListener('load', function() { + navigator.serviceWorker.register('{{AppSubUrl}}/serviceworker.js').then(function(registration) { + // Registration was successful + console.log('ServiceWorker registration successful with scope: ', registration.scope); + }, function(err) { + // registration failed :( + console.log('ServiceWorker registration failed: ', err); + }); + }); + } + + </script> + <meta name="theme-color" content="{{ThemeColorMetaTag}}"> <meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{MetaAuthor}}{{end}}" /> <meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{MetaDescription}}{{end}}" /> |