Abridge theme now has PWA support

Abridge theme has PWA support. You can install the entire site as an app and have it work offline.

2023-08-17_16-50-56

To try it out simply use chrome or your phone and go here: https://abridge.netlify.app/

If chrome on desktop then look at the address bar for the install button:

2023-08-17_16-27-36

On an android phone you should get a popup to install it:

It is also possible to install it from the menu:

2023-08-17_16-35-04

Then select Install app:

Once you have the PWA installed, you can go completely offline and you will still be able to browse or search the site!

To use it in your own instance you will need to edit abridge/static/sw.js for the list of files to cache. (or install your own version at mysite/static/sw.js which would override this file)

Technically you do not need to edit sw.js, but if even a single file in the cache list is missing then it wont pre cache the list, so it will only cache as you browse.

There is an npm script to handle minification:

npm run all or npm run pwa

If it ever becomes possible to template a js file in zola then it might be possible to generate the list of cache files dynamically at build, there could also be another way of doing it as well, but for now this is how it is. (I am still planning to add that functionality to Zola if I can, but I don’t have time at the moment)

The PWA feature is also easy to disable simply by setting pwa = false in config.toml

1 Like