mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
refactor(assets): PWA improvements and app config snake_case migration (#790)
- Service worker: versioned cache name, navigation preload, stale-while-revalidate for images
- New PWAModule extracted from MiscModule with async registration and update detection
- SW update notification toast in Hugo template with i18n support (16 languages)
- Web app manifest template (site.webmanifest) generated from [params.app] config
- [params.app] keys migrated to snake_case: name, short_name, pwa, no_favicon, svg_favicon, mask_color, tile_color, theme_color
- enablePWA moved from [params] to [params.app].pwa
- theme_color no longer accepts single-value, only {light, dark} map
- EventBus: new fixit:sw-update event
- SCSS: new _sw-toast.scss widget for update notification
This commit is contained in:
@@ -135,6 +135,17 @@
|
||||
{{- /* Custom widgets */ -}}
|
||||
{{- block "custom-widgets" . }}{{ end -}}
|
||||
|
||||
{{- /* Service Worker Update Notification */ -}}
|
||||
{{- if .Site.Params.app.pwa -}}
|
||||
<div class="sw-update-notification">
|
||||
<div class="sw-update-content">
|
||||
<p class="sw-update-title">{{ T "serviceWorker.updateTitle" }}</p>
|
||||
<p class="sw-update-text">{{ T "serviceWorker.updateText" }}</p>
|
||||
</div>
|
||||
<button type="button" class="sw-update-btn">{{ T "assets.refresh" }}</button>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<noscript>
|
||||
<div class="noscript-warning">{{ T "baseof.noscript" }}</div>
|
||||
</noscript>
|
||||
|
||||
Reference in New Issue
Block a user