cecil/theme-serviceworker

This package is abandoned and no longer maintained. No replacement package was suggested.

Cecil component theme service worker

Installs: 3 485

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Language:Twig

Type:cecil-theme

1.12.6 2022-05-03 13:58 UTC

README

This component theme is deprecated, replaced by https://github.com/Cecilapp/theme-pwa.

The Service Worker component theme for Cecil provides helpers to implement a service worker to turn a website into a Progressive Web App.

Prerequisites

Installation

composer require cecil/theme-serviceworker

Or download the latest archive and uncompress its content in themes/serviceworker.

Usage

Add serviceworker in the theme section of the config.yml:

theme:
  - serviceworker

Web manifest

Add the web manifest in the HTML <header> of the main template:

<link rel="manifest" href="{{ url('manifest') }}">

Configure it:

manifest:
  background_color: '#FFFFFF'
  theme_color: '#202020'
  icons:
    - icon-192x192.png
    - icon-512x512.png

Web manifest Optional

Add shortcuts:

manifest:
  shortcuts: true

Service worker

Register the service worker before the end of the HTML </body> of the main template:

{% include 'partials/regsw.js.twig' %}

Enable the service worker:

serviceworker:
  enabled: true

Service worker Optional

Define pre-cached files:

serviceworker:
  precache:
    - icon-192x192.png
    - icon-512x512.png
    - styles.css

Define ignored paths:

serviceworker:
  ignore:
    - name: 'cms'
      path: '/admin'