aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2020-05-01 17:35:08 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2020-05-01 17:35:08 +0200
commite2ffa7b3ad920d577cc56fbaaea12a99be125774 (patch)
tree09ea43dc6bfb3354c67b7b0f8701255bb74dd1f2
parentc672d64f126178f0facb91204761b1b913743d71 (diff)
Add manifest
-rw-r--r--assets/manifest.json15
-rw-r--r--assets/sw.js3
-rw-r--r--layouts/partials/docs/footer.html2
-rw-r--r--layouts/partials/docs/html-head.html4
-rw-r--r--static/favicon.svg1
5 files changed, 22 insertions, 3 deletions
diff --git a/assets/manifest.json b/assets/manifest.json
new file mode 100644
index 0000000..6a137ac
--- /dev/null
+++ b/assets/manifest.json
@@ -0,0 +1,15 @@
+{
+ "name": "{{ .Site.Title }}",
+ "short_name": "{{ .Site.Title }}",
+ "start_url": "{{ "/" | relURL }}",
+ "scope": "{{ "/" | relURL }}",
+ "display": "standalone",
+ "background_color": "#000000",
+ "theme_color": "#000000",
+ "icons": [
+ {
+ "src": "{{ "/favicon.svg" | relURL }}",
+ "sizes": "512x512"
+ }
+ ]
+}
diff --git a/assets/sw.js b/assets/sw.js
index d7d517a..0e7b0cf 100644
--- a/assets/sw.js
+++ b/assets/sw.js
@@ -8,10 +8,9 @@ const pages = [
self.addEventListener("install", function (event) {
self.skipWaiting();
- const precache = caches.open(cacheName).then((cache) => {
+ caches.open(cacheName).then((cache) => {
return cache.addAll(pages);
});
- event.waitUntil(precache);
});
self.addEventListener("fetch", (event) => {
diff --git a/layouts/partials/docs/footer.html b/layouts/partials/docs/footer.html
index abb1978..e171077 100644
--- a/layouts/partials/docs/footer.html
+++ b/layouts/partials/docs/footer.html
@@ -1,4 +1,4 @@
-<div class="flex justify-between">
+<div class="flex flex-wrap justify-between">
{{ if .Site.IsMultiLingual }}
{{ partial "docs/languages" . }}
{{ end }}
diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html
index 4b0c62f..905904f 100644
--- a/layouts/partials/docs/html-head.html
+++ b/layouts/partials/docs/html-head.html
@@ -1,10 +1,14 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ default .Summary .Description }}">
+<meta name="theme-color" content="#FFFFFF">
{{- template "_internal/opengraph.html" . -}}
<title>{{ partial "docs/title" . }} | {{ .Site.Title -}}</title>
+
+{{- $manifest := resources.Get "manifest.json" | resources.ExecuteAsTemplate "manifest.json" . }}
+<link rel="manifest" href="{{ $manifest.RelPermalink }}">
<link rel="icon" href="{{ "favicon.png" | relURL }}" type="image/x-icon">
{{- range .Translations }}
diff --git a/static/favicon.svg b/static/favicon.svg
new file mode 100644
index 0000000..a3c696d
--- /dev/null
+++ b/static/favicon.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M3 18h12v-2H3v2zM3 6v2h18V6H3zm0 7h18v-2H3v2z"/></svg> \ No newline at end of file