|
6 | 6 | <meta http-equiv="x-ua-compatible" content="ie=edge"> |
7 | 7 | <title>{{if .Title}}{{.Title | RenderEmojiPlain}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} </title> |
8 | 8 | <link rel="manifest" href="{{AppSubUrl}}/manifest.json" crossorigin="use-credentials"> |
9 | | - {{if UseServiceWorker}} |
10 | | - <script> |
11 | | - if ('serviceWorker' in navigator) { |
12 | | - navigator.serviceWorker.register('{{AppSubUrl}}/serviceworker.js').then(function(registration) { |
13 | | - // Registration was successful |
14 | | - console.info('ServiceWorker registration successful with scope: ', registration.scope); |
15 | | - }, function(err) { |
16 | | - // registration failed :( |
17 | | - console.info('ServiceWorker registration failed: ', err); |
18 | | - }); |
19 | | - } |
20 | | - </script> |
21 | | - {{else}} |
22 | | - <script> |
23 | | - if ('serviceWorker' in navigator) { |
24 | | - navigator.serviceWorker.getRegistrations().then(function(registrations) { |
25 | | - registrations.forEach(function(registration) { |
26 | | - registration.unregister(); |
27 | | - console.info('ServiceWorker unregistered'); |
28 | | - }); |
29 | | - }); |
30 | | - } |
31 | | - </script> |
32 | | - {{end}} |
33 | 9 | <meta name="theme-color" content="{{ThemeColorMetaTag}}"> |
34 | 10 | <meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{MetaAuthor}}{{end}}" /> |
35 | 11 | <meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{MetaDescription}}{{end}}" /> |
|
84 | 60 | </script> |
85 | 61 | <script> |
86 | 62 | window.config = { |
| 63 | + AppVer: '{{AppVer}}', |
87 | 64 | AppSubUrl: '{{AppSubUrl}}', |
88 | 65 | StaticUrlPrefix: '{{StaticUrlPrefix}}', |
| 66 | + UseServiceWorker: {{UseServiceWorker}}, |
89 | 67 | csrf: '{{.CsrfToken}}', |
90 | 68 | HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}}, |
91 | 69 | Minicolors: {{if .RequireMinicolors}}true{{else}}false{{end}}, |
|
0 commit comments