Sha256: cef62fe29cb8f5574097b0689b99a349c3bcbdb25a9444e92c0ba4930954d503

Contents?: true

Size: 1.66 KB

Versions: 32

Compression:

Stored size: 1.66 KB

Contents

---
layout: compress
permalink: '/:path/swconf.js'
# Note that this file will be fetched by the ServiceWorker, so it will not be cached.
---

const swconf = {
  {% if site.pwa.cache.enabled %}
    cacheName: 'chirpy-{{ "now" | date: "%s" }}',

    {%- comment -%} Resources added to the cache during PWA installation. {%- endcomment -%}
    resources: [
      '{{ "/assets/css/:THEME.css" | replace: ':THEME', site.theme | relative_url }}',
      '{{ "/" | relative_url }}',
      {% for tab in site.tabs %}
        '{{- tab.url | relative_url -}}',
      {% endfor %}

      {% assign cache_list = site.static_files | where: 'swcache', true %}
      {% for file in cache_list %}
        '{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
      {% endfor %}
    ],

    {%- comment -%} The request url with below domain will be cached. {%- endcomment -%}
    allowHosts: [
      {% if site.img_cdn and site.img_cdn contains '//' %}
        '{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
      {% endif %}

      {%- unless site.assets.self_host.enabled -%}
       {% for cdn in site.data.origin["cors"].cdns %}
          '{{ cdn.url | split: "//" | last }}'
          {%- unless forloop.last -%},{%- endunless -%}
        {% endfor %}
      {% endunless %}
    ],

    {%- comment -%} The request url with below path will not be cached. {%- endcomment -%}
    denyPaths: [
      {% for path in site.pwa.cache.deny_paths %}
        {% unless path == empty %}
          '{{ path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
        {% endunless  %}
      {% endfor %}
    ],
    purge: false
  {% else %}
    purge: true
  {% endif %}
};

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
jekyll-theme-chirpy-6.5.5 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-4.0.0 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-4.0.0.pre.beta2 assets/js/data/swconf.js
jekyll-theme-chirpy-6.5.3 assets/js/data/swconf.js
jekyll-theme-chirpy-6.5.2 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.2.0 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.2.0.pre.beta3 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.2.0.pre.beta2 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.2.0.pre.beta1 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.1.4 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.1.2 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.1.1 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.1.0 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.0.1 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-3.0.0 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-1.0.2 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-1.0.1 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-1.0.0 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-0.1.2 assets/js/data/swconf.js
jekyll-theme-chirpy-customized-upe-0.1.1 assets/js/data/swconf.js