From 211d08f9804c70943d7395175f25096483f006d0 Mon Sep 17 00:00:00 2001
From: Jieiku
Date: Sat, 19 Aug 2023 10:39:52 -0700
Subject: Version 2.0.0 Refactor, Add PWA Support
---
templates/macros/head.html | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
(limited to 'templates/macros/head.html')
diff --git a/templates/macros/head.html b/templates/macros/head.html
index 35afa5b..2c85f16 100644
--- a/templates/macros/head.html
+++ b/templates/macros/head.html
@@ -7,12 +7,23 @@
{%- if config.extra.js_switcher_default %}{%- if config.extra.js_switcher_default == "light" %}
{%- set js_theme="js/theme_light.min.js" -%}
{%- endif %}{%- endif %}
-
{%- endif %}
+
{%- endif %}
{%- endmacro %}
+{#- Service Worker for PWA #}
+{%- macro pwa(config) %}
+ {%- if config.extra.pwa | default(value=false) %}
+ {%- set js_swload=config.extra.js_swload | default(value="") -%}
+ {%- if not js_swload %}
+ {%- set js_swload="js/sw_load.min.js" -%}
+ {%- endif %}
+
+ {%- endif %}
+{%- endmacro %}
+
{%- macro stylesheets(config) %}
{%- set stylesheets=config.extra.stylesheets | default(value=[ "abridge.css" ]) -%}
@@ -54,7 +65,7 @@
{%- macro feed(config) %}
{%- if config.generate_feed %}
-
+
{%- endif %}
{%- endmacro %}
@@ -219,8 +230,8 @@
{%- endif %}
- {%- if config.extra.favicon_webmanifest %}
-
+ {%- if config.extra.webmanifest %}
+
{%- endif %}
{%- if config.extra.favicon_mask and config.extra.favicon_mask_color %}
--
cgit v1.3.1