{{- $url := "index.html?source=pwa" -}}
{{- $uuid := sha1 (printf "%s/%s" site.BaseURL $url) -}}
{
  "$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 }}
  "lang": "{{ site.LanguageCode | default site.Language.Lang }}",{{ with partialCached "func/GetLanguageDirection" "GetLanguageDirection" }}
  "dir": {{ . | jsonify }},{{ end }}
  "start_url": {{ (printf "/%s" $url) | jsonify }},
  "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{{ . }}",
      "purpose": "any maskable"
    }{{ if ne . 512 }},{{ end }}{{- end }}
  ]
}