diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-19 01:44:38 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-19 01:44:38 +0200 |
| commit | d9611790b73a4b4623c2516e3dbf5e3523761f53 (patch) | |
| tree | 2546abe710e3117e3e307358832932334cd674c8 /layouts | |
| parent | bd4bb369895e07ca6b4eed1439e8ca7a93ba4802 (diff) | |
| download | gohugo-theme-ed-d9611790b73a4b4623c2516e3dbf5e3523761f53.tar.gz | |
Add webmanifest
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/home.json.json | 2 | ||||
| -rw-r--r-- | layouts/_default/home.manifest.webmanifest | 25 | ||||
| -rw-r--r-- | layouts/partials/head.html | 2 |
3 files changed, 27 insertions, 2 deletions
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}} + ] +} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b0f1e58..3531d4f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -18,7 +18,7 @@ <link rel="icon" href="{{ site.Params.assets.favicon | default "favicon.ico" | relURL }}" sizes="any"><!-- 32×32 --> <link rel="icon" href="{{ site.Params.assets.svgicon | default "icon.svg" | relURL }}" type="image/svg+xml"> <link rel="apple-touch-icon" href="{{ site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | relURL }}"><!-- 180×180 --> - <link rel="manifest" href="{{ site.Params.assets.webmanifest | default "manifest.webmanifest" | relURL }}"> + <link rel="manifest" href="{{ "manifest.webmanifest" | relURL }}"> {{- /* RSS */}} {{ range .AlternativeOutputFormats }} |
