Files
sermon-notes/templates/base.html.twig
Ryan Prather b1726bba34 upd: PWA (#15)
add service worker script block, manifest file, and fix error for share button email
2026-03-26 18:34:11 -04:00

35 lines
1.2 KiB
Twig

<!DOCTYPE html>
<!--
Editorial by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel='manifest' href='{{ asset('manifest.json') }}'>
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
</head>
<body class='is-preload' onload='{% if onLoad is defined %}{{ onLoad }}{% endif %}'>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
.then(registration => {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
})
.catch(error => {
console.log('ServiceWorker registration failed: ', error);
});
});
}
</script>
</body>
</html>