krata/assets/js/data/swcache.js

65 lines
1.7 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 %}
2021-04-29 13:50:23 +02:00
/* --- Favicons --- */
{% assign favicon_path = "/assets/img/favicons" | relative_url %}
'{{ favicon_path }}/android-chrome-192x192.png',
'{{ favicon_path }}/android-chrome-512x512.png',
'{{ favicon_path }}/apple-touch-icon.png',
'{{ favicon_path }}/favicon-16x16.png',
'{{ favicon_path }}/favicon-32x32.png',
'{{ favicon_path }}/favicon.ico',
'{{ favicon_path }}/mstile-150x150.png',
'{{ favicon_path }}/site.webmanifest',
'{{ favicon_path }}/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 != empty and site.google_analytics.id %}
2021-04-10 08:51:04 +02:00
'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
];