krata/assets/js/data/swcache.js

73 lines
2.0 KiB
JavaScript
Raw Normal View History

2020-05-09 18:28:18 +02:00
---
layout: compress
2020-05-09 18:28:18 +02:00
# The list to be cached by PWA
---
2021-04-10 08:51:04 +02:00
const resource = [
2020-05-09 18:28:18 +02:00
2021-04-10 08:51:04 +02:00
/* --- CSS --- */
2021-01-23 08:07:18 +01:00
'{{ "/assets/css/style.css" | relative_url }}',
2020-05-09 18:28:18 +02:00
2021-04-10 08:51:04 +02:00
/* --- JavaScripts --- */
{% assign js_path = "/assets/js" | relative_url %}
'{{ js_path }}/dist/home.min.js',
'{{ js_path }}/dist/page.min.js',
'{{ js_path }}/dist/post.min.js',
'{{ js_path }}/dist/categories.min.js',
'{{ js_path }}/data/search.json',
'{{ "/app.js" | relative_url }}',
'{{ "/sw.js" | relative_url }}',
2020-05-09 18:28:18 +02:00
/* --- HTML --- */
'{{ "/index.html" | relative_url }}',
'{{ "/404.html" | relative_url }}',
2020-12-11 16:08:57 +01:00
{% for tab in site.tabs %}
2021-04-19 09:21:31 +02:00
'{{ tab.url | relative_url }}',
2020-05-09 18:28:18 +02:00
{% endfor %}
/* --- Icons --- */
2021-04-10 08:51:04 +02:00
{% assign icon_url = "/assets/img/favicons" | relative_url %}
2020-05-09 18:28:18 +02:00
'{{ icon_url }}/favicon.ico',
'{{ icon_url }}/apple-icon.png',
'{{ icon_url }}/apple-icon-precomposed.png',
'{{ icon_url }}/apple-icon-57x57.png',
'{{ icon_url }}/apple-icon-60x60.png',
'{{ icon_url }}/apple-icon-72x72.png',
'{{ icon_url }}/apple-icon-76x76.png',
'{{ icon_url }}/apple-icon-114x114.png',
'{{ icon_url }}/apple-icon-120x120.png',
'{{ icon_url }}/apple-icon-144x144.png',
'{{ icon_url }}/apple-icon-152x152.png',
'{{ icon_url }}/apple-icon-180x180.png',
'{{ icon_url }}/android-icon-192x192.png',
'{{ icon_url }}/favicon-32x32.png',
'{{ icon_url }}/favicon-96x96.png',
'{{ icon_url }}/favicon-16x16.png',
'{{ icon_url }}/ms-icon-144x144.png',
'{{ icon_url }}/manifest.json',
'{{ icon_url }}/browserconfig.xml'
2020-05-09 18:28:18 +02:00
];
2020-05-11 19:01:12 +02:00
2021-04-10 08:51:04 +02:00
/* The request url with below domain will be cached */
const allowedDomains = [
{% if site.google_analytics.id != '' %}
'www.googletagmanager.com',
'www.google-analytics.com',
{% endif %}
'{{ site.url | split: "//" | last }}',
'fonts.gstatic.com',
'fonts.googleapis.com',
'cdn.jsdelivr.net',
'polyfill.io'
];
/* Requests that include the following path will be banned */
const denyUrls = [
{% if site.google_analytics.pv.cache_path %}
'{{ site.google_analytics.pv.cache_path | absolute_url }}'
{% endif %}
2020-05-11 19:01:12 +02:00
];