1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 02:38:27 -04:00

automatically generate PWA manifest.json

This commit is contained in:
Jake Jarvis 2019-11-10 15:30:10 -05:00
parent 204479a882
commit f2fb8e812c
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
5 changed files with 60 additions and 4 deletions

View File

@ -35,7 +35,7 @@ disableAliases = true
copyrightFirstYear = "2001"
[outputs]
home = ["HTML", "RSS", "REDIRECTS", "HEADERS"]
home = ["HTML", "RSS", "MANIFEST", "REDIRECTS", "HEADERS"]
section = ["HTML"]
[mediaTypes]
@ -43,6 +43,10 @@ disableAliases = true
delimiter = ""
[outputFormats]
[outputFormats.MANIFEST]
mediaType = "application/json"
baseName = "manifest"
notAlternative = true
[outputFormats.REDIRECTS]
mediatype = "text/netlify"
baseName = "_redirects"

View File

@ -0,0 +1,45 @@
{
"name": "{{ .Site.Title }}",
"short_name": "{{ .Site.Params.domain }}",
"icons": [
{
"src": "{{ "favicon-512.png" | absURL }}",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "{{ "favicon-192.png" | absURL }}",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "{{ "favicon-180.png" | absURL }}",
"sizes": "180x180",
"type": "image/png"
},
{
"src": "{{ "favicon-152.png" | absURL }}",
"sizes": "152x152",
"type": "image/png"
},
{
"src": "{{ "favicon-128.png" | absURL }}",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "{{ "favicon-96.png" | absURL }}",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "{{ "favicon-64.png" | absURL }}",
"sizes": "64x64",
"type": "image/png"
}
],
"start_url": "{{ .Site.BaseURL }}",
"display": "browser",
"background_color": "#ffffff",
"theme_color": "#0e6dc2"
}

View File

@ -34,9 +34,12 @@
<meta name="twitter:creator" content="{{ .Site.Author.twitter }}">
<meta name="twitter:dnt" content="on">
<meta name="twitter:widgets:csp" content="on">
<link rel="canonical" href="{{ .Permalink }}">
<link rel="alternate" type="application/rss+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
{{- $style := resources.Get "sass/main.scss" | resources.ToCSS (dict "targetPath" "style.css" "outputStyle" "compact") }}
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="{{ .Site.Title }}">
<meta name="theme-color" content="#0e6dc2">
<link rel="manifest" href="{{ "manifest.json" | absURL }}">
{{- $style := resources.Get "sass/main.scss" | resources.ToCSS (dict "targetPath" "style.css" "outputStyle" "compact") }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}">
<link rel="icon" href="{{ "favicon-192.png" | absURL }}" sizes="192x192">
@ -44,6 +47,8 @@
<link rel="icon" href="{{ "favicon-32.png" | absURL }}" sizes="32x32">
<link rel="icon" href="{{ "favicon-16.png" | absURL }}" sizes="16x16">
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}">
<link rel="canonical" href="{{ .Permalink }}">
<link rel="alternate" type="application/rss+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
<link rel="author" href="{{ "humans.txt" | absURL }}">
</head>
<body id="{{ .Type }}">

View File

@ -18,9 +18,11 @@
[[redirects]]
from = "/feed"
to = "/index.xml"
status = 200
[[redirects]]
from = "/rss"
to = "/index.xml"
status = 200
# Moved Y2K site to its own subdomain:
[[redirects]]

BIN
static/favicon-512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB