From 77831a1df6172107a481bc2834f918a07c8e5c7f Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sat, 19 Oct 2024 21:00:24 -0400 Subject: [PATCH 1/4] Attempt at offline posts page --- content/offline.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/content/offline.md b/content/offline.md index cce8ac6..2cbab91 100644 --- a/content/offline.md +++ b/content/offline.md @@ -9,3 +9,78 @@ Your device is offline. You may have some pages cached for offline viewing, otherwise please wait for the internet to reconnect to continue browsing. [Homepage](/) + +{{< unsafe >}} + + + + + +{{< /unsafe >}} \ No newline at end of file From 251e3355dedcbb01949f8bbab7f3484de9d7f458 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sat, 19 Oct 2024 21:06:12 -0400 Subject: [PATCH 2/4] Call listPages on page load --- content/offline.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/offline.md b/content/offline.md index 2cbab91..30f833b 100644 --- a/content/offline.md +++ b/content/offline.md @@ -81,6 +81,10 @@ async function listPages() { return result; } + +document.addEventListener("DOMContentLoaded", (event) => { + listPages() +}); {{< /unsafe >}} \ No newline at end of file From 3161801ca58685424a11ef2864678f618536fa04 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sat, 19 Oct 2024 21:11:48 -0400 Subject: [PATCH 3/4] Service worker update --- content/offline.md | 4 +++- themes/pulp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/content/offline.md b/content/offline.md index 30f833b..65b406c 100644 --- a/content/offline.md +++ b/content/offline.md @@ -83,7 +83,9 @@ async function listPages() { } document.addEventListener("DOMContentLoaded", (event) => { - listPages() + if (navigator && navigator.serviceWorker) { + listPages() + } }); diff --git a/themes/pulp b/themes/pulp index df0ec44..be3e20f 160000 --- a/themes/pulp +++ b/themes/pulp @@ -1 +1 @@ -Subproject commit df0ec44936cb06d4ec0282e3cd057321ad655b2a +Subproject commit be3e20feb6562044b0b6559810d4482bf90f9ef2 From 5f0441e62983761ffb6aed62c2ba961c6bd4a28e Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sat, 19 Oct 2024 21:38:51 -0400 Subject: [PATCH 4/4] Fixing up offline page --- content/offline.md | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/content/offline.md b/content/offline.md index 65b406c..ac70121 100644 --- a/content/offline.md +++ b/content/offline.md @@ -8,17 +8,19 @@ hidden: true Your device is offline. You may have some pages cached for offline viewing, otherwise please wait for the internet to reconnect to continue browsing. -[Homepage](/) - {{< unsafe >}} -
    +