From 6c16f5afa99b987a5e2e3114d49ed9ef8a8ee1e0 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Tue, 21 Dec 2021 10:31:52 +0100 Subject: [PATCH] added web app manifest --- README.md | 1 + content/manifest.md | 7 +++++++ layouts/_default/manifest.json | 31 +++++++++++++++++++++++++++++++ layouts/partials/head.html | 5 +++-- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 content/manifest.md create mode 100644 layouts/_default/manifest.json diff --git a/README.md b/README.md index f10c246..57199ef 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ summaryLength = 70 # number of words for article summaries faviconIco = "/favicon.ico" # 32x32 appletouch = "/apple-touch-icon.png" # 180x180 svgicon = "/logo.svg" + icon512 = "/icon512.png" # 512x512 png image showTags = true # show the Tags menu item; default true showRss = true # show the link for the RSS feed; default true diff --git a/content/manifest.md b/content/manifest.md new file mode 100644 index 0000000..d92fde6 --- /dev/null +++ b/content/manifest.md @@ -0,0 +1,7 @@ +--- +title: Manifest +layout: manifest +outputs: + - "json" +norss: true +--- diff --git a/layouts/_default/manifest.json b/layouts/_default/manifest.json new file mode 100644 index 0000000..ddd88ab --- /dev/null +++ b/layouts/_default/manifest.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/web-manifest-combined.json", + "name": "{{ .Site.Title }}", + "short_name": "{{ .Site.Title }}", + "start_url": "/", + "display": "standalone", + "background_color": "{{ .Site.Params.backgroundColor | default "#242629" }}", + "theme_color": "{{ .Site.Params.accentColor | default "#db5793" }}" + {{ if .Site.Params.description }} + , + "description": "{{ .Site.Params.description }}" + {{ end }} + {{ if .Site.Params.icon512 }} + , + "icons": [ + { + "src": "{{ .Site.Params.icon512 }}", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "{{ .Site.Params.icon512 }}", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" + } + ] + {{ end }} +} + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 20f5413..b609ad2 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -23,11 +23,12 @@ {{ end }} {{ .Site.Title | default "Ficurinia" }} - - + + {{ $style := resources.Get "/scss/style.scss" | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") | resources.Fingerprint "sha512" }} {{- partial "inject/head.html" . -}} {{- partial "head_meta_seo.html" . -}} {{- partial "head_meta_opengraph.html" . -}} +