Skip to content

Commit

Permalink
feat: update pwa automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfux committed Oct 26, 2024
1 parent 3a8bd88 commit 98017e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ $ docker cp cover.webp kungfux.github.io:/workspaces/kungfux.github.io/assets/me
`assets/css/jekyll-theme-chirpy.scss`
- Adjust styles for schemas and code blocks
`assets/css/jekyll-theme-chirpy.scss`
- Align lists by center
`assets/css/jekyll-theme-chirpy.scss`
- Single line post titles
`assets/css/jekyll-theme-chirpy.scss`
- Update site title tag from `<h1>` to `<p>`
`_includes/sidebar.html`
- Add progress bar to back to top
`assets/js/progress.js`, `assets/css/jekyll-theme-chirpy.scss`
`assets/js/progress.js`, `assets/css/jekyll-theme-chirpy.scss`, `_includes/metadata-hook.html`
- Trigger PWA update automatically
`assets/js/auto-update.js`, `_includes/metadata-hook.html`
1 change: 1 addition & 0 deletions _includes/metadata-hook.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<script src="/assets/js/progress.js" defer></script>
<script src="/assets/js/auto-update.js" defer></script>
5 changes: 5 additions & 0 deletions assets/js/auto-update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const toast = document.getElementById('notification');
toast.addEventListener('shown.bs.toast', () => {
const button = toast.querySelector('.toast-body>button');
button?.click();
});

0 comments on commit 98017e8

Please sign in to comment.