From d9611790b73a4b4623c2516e3dbf5e3523761f53 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Thu, 19 May 2022 01:44:38 +0200 Subject: Add webmanifest --- layouts/_default/home.json.json | 2 +- layouts/_default/home.manifest.webmanifest | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/home.manifest.webmanifest (limited to 'layouts/_default') diff --git a/layouts/_default/home.json.json b/layouts/_default/home.json.json index a86e88d..6df1514 100644 --- a/layouts/_default/home.json.json +++ b/layouts/_default/home.json.json @@ -1,6 +1,6 @@ { "version": "https://jsonfeed.org/version/1.1", - "title": {{ (printf "%s JSON Feed" site.Title) | jsonify }}, + "title": {{ (printf "%s JSON Feed" site.Title) | htmlUnescape | jsonify }}, "home_page_url": {{ site.BaseURL | absURL | jsonify }}, {{ with .OutputFormats.Get "JSON" }}"feed_url": {{.Permalink | absURL | jsonify }},{{ end }} {{ with site.Params.description}}"description": {{site.Params.description | jsonify}},{{end}} diff --git a/layouts/_default/home.manifest.webmanifest b/layouts/_default/home.manifest.webmanifest new file mode 100644 index 0000000..5e78f2a --- /dev/null +++ b/layouts/_default/home.manifest.webmanifest @@ -0,0 +1,25 @@ +{ + "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 }},{{ end }} + "start_url": "/index.html", + "display": "fullscreen", + "orientation": "natural", + "dir": "ltr", + "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 144 192 256 512}}{{ range $t }} + { + "src": "/img/yy{{.}}.png", + "type": "image/png", + "sizes": "{{.}}x{{.}}" + }{{ if ne . 512 }},{{end }}{{- end}} + ] +} -- cgit v1.2.3