Skip to content

Commit

Permalink
Add some basic offline support
Browse files Browse the repository at this point in the history
  • Loading branch information
trey committed Aug 30, 2024
1 parent f7c0e6f commit 754bce3
Show file tree
Hide file tree
Showing 72 changed files with 11,023 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/urls.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ from core.forms import RegisterForm
urlpatterns = [
path("", views.placeholder, name="index"),
path("private-page", views.private_page, name="private-page"),
# PWA goodies
path(
"sw.js",
TemplateView.as_view(
template_name="js/sw.js", content_type="application/javascript"
),
name="sw",
),
path("offline", TemplateView.as_view(template_name="offline.html"), name="offline"),
path("favicon.ico", views.favicon),
# Redirect the old registration URL.
path(
Expand Down
10 changes: 10 additions & 0 deletions documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ However, if you still want to use Tailwind (no judgement), here's how you can do
- [Fly](deployment/fly.md)

Why no AWS? We don't believe you should use it. We do our best to not give Amazon any money if we can help it.

## Update Workbox

- `npx workbox-cli copyLibraries static/js/vendor/`
- Update paths in `templates/js/sw.js` as needed.

Further reading:

- [Using Local Workbox Files Instead of CDN](https://developer.chrome.com/docs/workbox/modules/workbox-sw/#using-local-workbox-files-instead-of-cdn)
- [workbox-cli’s copylibraries option](https://developer.chrome.com/docs/workbox/modules/workbox-cli/#copylibraries)
Loading

0 comments on commit 754bce3

Please sign in to comment.