diff options
author | vimux <vimux@protonmail.com> | 2019-08-28 17:26:30 +0300 |
---|---|---|
committer | vimux <vimux@protonmail.com> | 2019-08-28 18:21:46 +0300 |
commit | 407c5d72df789dfbd8af37a1f1d59d17755954ff (patch) | |
tree | 2080eabc7e7d7321752a65ffde2c96bed953469b /layouts | |
parent | b8650503eb799513848fa75164d2c211bcd93a7b (diff) |
Web Manifest: don't require .Site.Params.Manifest
Before, `.Site.Params.Manifest` was required to activate
Web App Manifest. Now, it's optional. Still, `.Site.Params.Manifest`
highly recommended.
* Don't require .Site.Params.Manifest
* Order Web App Manifest properties by required type (except icons)
* Add default value to startUrl param [`/`]
* README.md: enhance Web App Manifest configuration section
* README.md: add table with Web App Manifest default values in Binario
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 4 | ||||
-rw-r--r-- | layouts/index.manifest.json | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6577dd7..07ffe01 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -26,8 +26,8 @@ {{- with .OutputFormats.Get "rss" }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} {{- end }} - {{- if and (.Site.Params.Manifest) ((.Site.GetPage "home").OutputFormats.Get "manifest") -}} - <link rel="manifest" href="{{ "manifest.json" | relURL }}"> + {{- with ((.Site.GetPage "home").OutputFormats.Get "manifest") }} + <link rel="manifest" href="{{ "manifest.json" | relURL }}"> {{- end }} {{- if not .Site.IsServer }} {{ template "_internal/google_analytics_async.html" . }} diff --git a/layouts/index.manifest.json b/layouts/index.manifest.json index ba519f2..ffbd6ef 100644 --- a/layouts/index.manifest.json +++ b/layouts/index.manifest.json @@ -1,7 +1,8 @@ { - "name": "{{ if .Site.Params.Manifest.name }}{{ .Site.Params.Manifest.name }}{{ else }}{{ .Site.Title }}{{ end }}", - "short_name": "{{ if .Site.Params.Manifest.shortName }}{{ .Site.Params.Manifest.shortName }}{{ else }}{{ .Site.Title }}{{ end }}", + "name": "{{ .Site.Params.Manifest.name | default .Site.Title }}", + "short_name": "{{ .Site.Params.Manifest.shortName | default .Site.Title }}", "display": "{{ .Site.Params.Manifest.display | default "browser" }}", + "start_url": "{{ .Site.Params.Manifest.startUrl | default "/" }}", "background_color": "{{ .Site.Params.Manifest.backgroundColor | default "#2a2a2a" }}", "theme_color": "{{ .Site.Params.Manifest.themeColor | default "#1b1b1b" }}", {{- with .Site.Params.Manifest.description }} @@ -10,9 +11,6 @@ {{- with .Site.Params.Manifest.orientation }} "orientation": "{{ . }}", {{- end }} - {{- with .Site.Params.Manifest.startUrl }} - "start_url": "{{ . }}", - {{- end }} {{- with .Site.Params.Manifest.scope }} "scope": "{{ . }}", {{- end }} |