This is a simple demo to illustrate how to turn a Hugo Website into a Progressive Web App.
This means that your website can be installed by you users, on the desktop (Chromium only) or their mobiles, and even be used offline. That's pretty powerful, especially for static websites built with Hugo!
There are just a few steps to take:
- Add a
manifest.json
file to/static
, which describes your PWA. Here is a more thorough description of the file and its content. - Add a link to the manifest in all your HTML pages. The easiest is to add it to
layouts/partials/head-additions.html
as done here - Add a Service Worker, which will handle the behavior of the app. Here, the worker is simply responsible for caching the pages, and serving them when the app is offline. Credits to offline-first-sw
- Register the worker. See the
<script>
inhead-additions.html