1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{{- $uuid := sha1 (printf "%s/index.html?homescreen=1" site.BaseURL) -}}
{
"$schema": "https://json.schemastore.org/web-manifest",
"id": "{{ substr $uuid 0 8 }}-{{ substr $uuid 8 4 }}-5{{ substr $uuid 13 3 }}-{{ substr $uuid 16 1 }}9{{ substr $uuid 17 2 }}-{{ substr $uuid 21 12 }}",
"name": {{ site.Title | htmlUnescape | jsonify }},
{{ with site.Params.tagline }}"short_name": {{ . | htmlUnescape | jsonify }},{{ end }}
{{ with site.Params.description }}"description": {{ . | htmlUnescape | jsonify }},{{ end }}
{{ with site.LanguageCode }}"lang": {{ . | jsonify }},
"dir": "ltr", {{/* TODO: Get dir from lang */}}{{ end }}
"start_url": "/index.html?homescreen=1",
"display": "fullscreen",
"theme_color": "#ffffff",
"background_color": "#ffffff",
"orientation": "natural",
"shortcuts": [ {{ range $index, $m := site.Menus.main }} {{ if or (lt .Weight 900) site.IsServer }}
{{- if $index }},{{ end }}
{
"name": {{ $m.Name | jsonify }},
"short_name" : {{ $m.Identifier | jsonify }},
"url": {{ $m.URL | jsonify }}
}{{ end }}{{ end }}
],
"icons": [{{ $t := slice 192 512 }}{{ range $t }}
{
"src": "/icon-{{ . }}.png",
"type": "image/png",
"sizes": "{{ . }}x{{ . }}"
}{{ if ne . 512 }},{{ end }}{{- end }}
]
}
|