feat: dynamically generate manifest

Adds name, lang, theme_color and background_color.

Removes 32px icon and adds 512px icon based on latest Google best
practices.
This commit is contained in:
George Cushen committed 2019-07-27 22:56:26 +01:00
1 parent 8688f1d4af
commit 0011592861
4 files changed
+30 -15

No files matched your search

+8 -1
View File
@@ -40,9 +40,16 @@ footnotereturnlinkcontents = "<sup>^</sup>"
ignoreFiles = ["\\.ipynb$", ".ipynb_checkpoints$", "\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
[outputs]
home = [ "HTML", "RSS", "JSON" ]
home = [ "HTML", "RSS", "JSON", "WebAppManifest" ]
section = [ "HTML", "RSS" ]
[mediaTypes."application/manifest+json"]
suffixes = ["webmanifest"]
[outputFormats.WebAppManifest]
mediaType = "application/manifest+json"
rel = "manifest"
# Configure BlackFriday Markdown rendering.
# See: https://gohugo.io/getting-started/configuration/#configure-blackfriday
[blackfriday]
+18
View File
@@ -0,0 +1,18 @@
{{- $scr := .Scratch -}}
{
"name": "{{site.Title}}",
"lang": "{{site.LanguageCode}}",
"theme_color": "{{ $scr.Get "primary" }}",
"background_color": "{{ $scr.Get "primary" }}",
"icons": [{
"src": "img/icon-192.png",
"sizes": "192x192",
"type": "image/png"
}{{- if (fileExists "static/img/icon-512.png") -}}, {
"src": "img/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}{{end}}],
"display": "standalone",
"start_url": "./?utm_source=web_app_manifest"
}
+4 -1
View File
@@ -138,7 +138,10 @@
<link rel="alternate" href="{{.RelPermalink}}" type="application/rss+xml" title="{{site.Title}}">
{{ end }}
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
{{ range .AlternativeOutputFormats }}
<link rel="{{.Rel}}" type="{{.MediaType.Type}}" href="{{.RelPermalink | safeURL}}">
{{ end }}
<link rel="icon" type="image/png" href="{{ "/img/icon.png" | relURL }}">
<link rel="apple-touch-icon" type="image/png" href="{{ "/img/icon-192.png" | relURL }}">
-13
View File
@@ -1,13 +0,0 @@
{
"icons": [{
"src": "img/icon.png",
"sizes": "32x32",
"type": "image/png"
},{
"src": "img/icon-192.png",
"sizes": "192x192",
"type": "image/png"
}],
"display": "standalone",
"start_url": "./?utm_source=web_app_manifest"
}