Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Progressive Web App #4730

Merged
merged 14 commits into from
Nov 27, 2018
Prev Previous commit
Next Next commit
Complete adding {{AppSubUrl}}
  • Loading branch information
SohnyBohny committed Oct 29, 2018
commit b7548dbb650f04fed935eb755b5c1aa9c57b195a
4 changes: 2 additions & 2 deletions templates/base/head.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<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="/manifest.json">
<link rel="manifest" href="{{AppSubUrl}}/manifest.json">

<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/serviceworker.js').then(function(registration) {
navigator.serviceWorker.register('{{AppSubUrl}}/serviceworker.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
Expand Down
5 changes: 3 additions & 2 deletions templates/pwa/manifest_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
"name": "Gitea - Git with a cup of tea",
"icons": [
{
"src": "/img/gitea-lg.png",
"src": "{{AppSubUrl}}/img/gitea-lg.png",
"type": "image/png",
"sizes": "880x880"
},
{
"src": "/img/gitea-sm.png",
"src": "{{AppSubUrl}}/img/gitea-sm.png",
"type": "image/png",
"sizes": "120x120"
}
],
"start_url": "{{AppSubUrl}}/",
"scope": "{{AppSubUrl}}/",
"background_color": "#FAFAFA",
"display": "standalone",
"theme_color": "{{ThemeColorMetaTag}}"
Expand Down