summaryrefslogtreecommitdiffstats
path: root/templates/pwa
diff options
context:
space:
mode:
authorJakob Ackermann <das7pad@outlook.com>2019-10-22 14:11:01 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2019-10-22 20:11:01 +0800
commit00629fea95970e99ba5ef05954bbad0804805df6 (patch)
tree1590e0f7913c71689727cc17a3bf2786b43028ce /templates/pwa
parentd0c7a08d751bd068e557efe56683b999d29eb910 (diff)
downloadgitea-00629fea95970e99ba5ef05954bbad0804805df6.tar.gz
gitea-00629fea95970e99ba5ef05954bbad0804805df6.zip
[assets] configurable URL for static resources (#7911)
* static url * add cors support for static resources * [assets] work on the migration to configurable url for assets Signed-off-by: Jakob Ackermann <das7pad@outlook.com> * [misc] fix whitespace Signed-off-by: Jakob Ackermann <das7pad@outlook.com> * [assets] fix the loading of the manifest.json It is generated dynamically, and as such can not be served by the cdn. Signed-off-by: Jakob Ackermann <das7pad@outlook.com> * Revert "add cors support for static resources" This reverts commit 42f964fd181dbb8b139808b9be623470d4f0e40f Signed-off-by: Jakob Ackermann <das7pad@outlook.com> * [docs] add the STATIC_URL_PREFIX option Signed-off-by: Jakob Ackermann <das7pad@outlook.com> * [docs] reverse-proxy: nginx: add two setups for STATIC_URL_PREFIX Signed-off-by: Jakob Ackermann <das7pad@outlook.com> * [assets] migrate the url of a new asset to the static url prefix REF: f2a3abc683ad4b2177b7c7c6160a2c0b4316120a Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
Diffstat (limited to 'templates/pwa')
-rw-r--r--templates/pwa/manifest_json.tmpl10
-rw-r--r--templates/pwa/serviceworker_js.tmpl76
2 files changed, 43 insertions, 43 deletions
diff --git a/templates/pwa/manifest_json.tmpl b/templates/pwa/manifest_json.tmpl
index 557bee5d76..793b42f2e1 100644
--- a/templates/pwa/manifest_json.tmpl
+++ b/templates/pwa/manifest_json.tmpl
@@ -3,22 +3,22 @@
"name": "Gitea - Git with a cup of tea",
"icons": [
{
- "src": "{{AppSubUrl}}/img/gitea-lg.png",
+ "src": "{{StaticUrlPrefix}}/img/gitea-lg.png",
"type": "image/png",
"sizes": "880x880"
},
{
- "src": "{{AppSubUrl}}/img/gitea-sm.png",
+ "src": "{{StaticUrlPrefix}}/img/gitea-sm.png",
"type": "image/png",
"sizes": "120x120"
},
{
- "src": "{{AppSubUrl}}/img/gitea-512.png",
+ "src": "{{StaticUrlPrefix}}/img/gitea-512.png",
"type": "image/png",
"sizes": "512x512"
},
{
- "src": "{{AppSubUrl}}/img/gitea-192.png",
+ "src": "{{StaticUrlPrefix}}/img/gitea-192.png",
"type": "image/png",
"sizes": "192x192"
}
@@ -28,4 +28,4 @@
"background_color": "#FAFAFA",
"display": "standalone",
"theme_color": "{{ThemeColorMetaTag}}"
- } \ No newline at end of file
+ }
diff --git a/templates/pwa/serviceworker_js.tmpl b/templates/pwa/serviceworker_js.tmpl
index ee96cd5f68..5a2756cf24 100644
--- a/templates/pwa/serviceworker_js.tmpl
+++ b/templates/pwa/serviceworker_js.tmpl
@@ -1,55 +1,55 @@
var STATIC_CACHE = 'static-cache-v1';
var urlsToCache = [
// js
- '{{AppSubUrl}}/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js',
- '{{AppSubUrl}}/vendor/plugins/jquery/jquery.min.js?v=3.4.1',
- '{{AppSubUrl}}/vendor/plugins/jquery-migrate/jquery-migrate.min.js?v=3.0.1',
- '{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js',
- '{{AppSubUrl}}/js/index.js?v={{MD5 AppVer}}',
- '{{AppSubUrl}}/js/draw.js',
- '{{AppSubUrl}}/vendor/plugins/clipboard/clipboard.min.js',
- '{{AppSubUrl}}/vendor/plugins/gitgraph/gitgraph.js',
- '{{AppSubUrl}}/vendor/plugins/vue/vue.min.js',
- '{{AppSubUrl}}/vendor/plugins/emojify/emojify.min.js',
- '{{AppSubUrl}}/vendor/plugins/cssrelpreload/loadCSS.min.js',
- '{{AppSubUrl}}/vendor/plugins/cssrelpreload/cssrelpreload.min.js',
- '{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.js',
- '{{AppSubUrl}}/vendor/plugins/highlight/highlight.pack.js',
- '{{AppSubUrl}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.js',
- '{{AppSubUrl}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js',
- '{{AppSubUrl}}/vendor/plugins/codemirror/addon/mode/loadmode.js',
- '{{AppSubUrl}}/vendor/plugins/codemirror/mode/meta.js',
- '{{AppSubUrl}}/vendor/plugins/simplemde/simplemde.min.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/jquery/jquery.min.js?v=3.4.1',
+ '{{StaticUrlPrefix}}/vendor/plugins/jquery-migrate/jquery-migrate.min.js?v=3.0.1',
+ '{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.js',
+ '{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}',
+ '{{StaticUrlPrefix}}/js/draw.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.min.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/cssrelpreload/loadCSS.min.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/cssrelpreload/cssrelpreload.min.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/dropzone/dropzone.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/highlight/highlight.pack.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js',
+ '{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js',
// css
- '{{AppSubUrl}}/vendor/assets/font-awesome/css/font-awesome.min.css',
- '{{AppSubUrl}}/vendor/assets/octicons/octicons.min.css',
- '{{AppSubUrl}}/vendor/plugins/simplemde/simplemde.min.css',
- '{{AppSubUrl}}/vendor/plugins/gitgraph/gitgraph.css',
- '{{AppSubUrl}}/vendor/plugins/tribute/tribute.css',
- '{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.css',
- '{{AppSubUrl}}/css/index.css?v={{MD5 AppVer}}',
- '{{AppSubUrl}}/vendor/plugins/highlight/github.css',
- '{{AppSubUrl}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css',
- '{{AppSubUrl}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.css',
- '{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.css',
+ '{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css',
+ '{{StaticUrlPrefix}}/vendor/assets/octicons/octicons.min.css',
+ '{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css',
+ '{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.css',
+ '{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css',
+ '{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.css',
+ '{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}',
+ '{{StaticUrlPrefix}}/vendor/plugins/highlight/github.css',
+ '{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css',
+ '{{StaticUrlPrefix}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.css',
+ '{{StaticUrlPrefix}}/vendor/plugins/dropzone/dropzone.css',
{{if .IsSigned }}
{{ if ne .SignedUser.Theme "gitea" }}
- '{{AppSubUrl}}/css/theme-{{.SignedUser.Theme}}.css',
+ '{{StaticUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css',
{{end}}
{{else if ne DefaultTheme "gitea"}}
- '{{AppSubUrl}}/css/theme-{{DefaultTheme}}.css',
+ '{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css',
{{end}}
// img
- '{{AppSubUrl}}/img/gitea-sm.png',
- '{{AppSubUrl}}/img/gitea-lg.png',
+ '{{StaticUrlPrefix}}/img/gitea-sm.png',
+ '{{StaticUrlPrefix}}/img/gitea-lg.png',
// fonts
- '{{AppSubUrl}}/vendor/plugins/semantic/themes/default/assets/fonts/icons.woff2',
- '{{AppSubUrl}}/vendor/assets/octicons/octicons.woff2?ef21c39f0ca9b1b5116e5eb7ac5eabe6',
- '{{AppSubUrl}}/vendor/assets/lato-fonts/lato-v14-latin-regular.woff2',
- '{{AppSubUrl}}/vendor/assets/lato-fonts/lato-v14-latin-700.woff2'
+ '{{StaticUrlPrefix}}/vendor/plugins/semantic/themes/default/assets/fonts/icons.woff2',
+ '{{StaticUrlPrefix}}/vendor/assets/octicons/octicons.woff2?ef21c39f0ca9b1b5116e5eb7ac5eabe6',
+ '{{StaticUrlPrefix}}/vendor/assets/lato-fonts/lato-v14-latin-regular.woff2',
+ '{{StaticUrlPrefix}}/vendor/assets/lato-fonts/lato-v14-latin-700.woff2'
];
self.addEventListener('install', function (event) {