Skip to content

Commit 7f3068b

Browse files
committed
Cleanups
1 parent f2e6063 commit 7f3068b

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

source/_extensions/pwa_service.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ def get_files_to_cache(outDir: str, config: Dict[str, Any]):
7171
resource_url = urljoin(
7272
url, name
7373
)
74-
logger.info(f"Caching {resource_url}")
7574
files_to_cache.append(resource_url)
7675
else:
7776
resource_url = url + dirpath + "/" + name
78-
79-
logger.info(f"Name is {name}")
80-
logger.info(f"Caching {resource_url}")
8177
files_to_cache.append(resource_url)
8278

8379
return files_to_cache
@@ -114,14 +110,20 @@ def html_page_context(
114110
"metatags"
115111
] += f'<link rel="manifest" href="_static/frcdocs.webmanifest"/>'
116112

113+
if app.config["pwa_apple_icon"] is not None:
114+
context[
115+
"metatags"
116+
] += f'<link rel="apple-touch-icon" href="{app.config["pwa_apple_icon"]}">'
117+
117118

118119
def setup(app: Sphinx) -> Dict[str, Any]:
119-
app.add_config_value("name", "", "html")
120-
app.add_config_value("short_name", "", "html")
121-
app.add_config_value("theme_color", "", "html")
122-
app.add_config_value("background_color", "", "html")
123-
app.add_config_value("display", "standalone", "html")
124-
app.add_config_value("icons", [], "html")
120+
app.add_config_value("pwa_name", "", "html")
121+
app.add_config_value("pwa_short_name", "", "html")
122+
app.add_config_value("pwa_theme_color", "", "html")
123+
app.add_config_value("pwa_background_color", "", "html")
124+
app.add_config_value("pwa_display", "standalone", "html")
125+
app.add_config_value("pwa_icons", [], "html")
126+
app.add_config_value("pwa_apple_icon", "", "html")
125127

126128
app.connect("html-page-context", html_page_context)
127129
app.connect("build-finished", build_finished)

source/_static/touch-icon.png

30.1 KB
Loading

source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@
178178
# Use MathJax3 for better page loading times
179179
mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
180180

181+
# PWA Specific Settings
182+
pwa_apple_icon = "_static/touch-icon.png"
183+
181184

182185
# -- Options for HTML output -------------------------------------------------
183186

0 commit comments

Comments
 (0)