cecil / theme-serviceworker
Cecil component theme service worker
Fund package maintenance!
ArnaudLigny
Open Collective
www.paypal.me/narno
Installs: 3 485
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Language:Twig
Type:cecil-theme
Requires
- cecil/theme-installer: ^1.4
This package is auto-updated.
Last update: 2023-03-01 00:31:23 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
- A Cecil website
- A supported browser
- HTTPS
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'