From 9b8054de562c1750ea45a5182edcfbeb36bb32ec Mon Sep 17 00:00:00 2001 From: vimux Date: Tue, 22 May 2018 13:12:29 +0300 Subject: [PATCH] Add new parameters for Web App Manifest Now, you can specify parameters through site config file --- layouts/index.manifest.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/layouts/index.manifest.json b/layouts/index.manifest.json index e5d06e3..be3ccd0 100644 --- a/layouts/index.manifest.json +++ b/layouts/index.manifest.json @@ -1,9 +1,13 @@ { - "name": "{{ .Site.Title }}", - "short_name": "{{ .Site.Title }}", - "display": "browser", - "background_color": "#2a2a2a", - "theme_color": "#1b1b1b", + "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 }}", + "display": "{{ .Site.Params.Manifest.display | default "browser" }}", + "background_color": "{{ .Site.Params.Manifest.backgroundColor | default "#2a2a2a" }}", + "theme_color": "{{ .Site.Params.Manifest.themeColor | default "#1b1b1b" }}", + {{- with .Site.Params.Manifest.description }}"description": "{{ . }}",{{ end }} + {{- with .Site.Params.Manifest.orientation }}"orientation": "{{ . }}",{{ end }} + {{- with .Site.Params.Manifest.startUrl }}"start_url": "{{ . }}",{{ end }} + {{- with .Site.Params.Manifest.scope }}"scope": "{{ . }}",{{ end }} "icons": [ { "src": "icons/192.png",