Complete PWA implementation

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-09-11 04:44:02 +05:30
parent f436c79b42
commit 367541b317
11 changed files with 29 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
static/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

9
static/browserconfig.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2b5797</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
static/mstile-150x150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -3,16 +3,24 @@
"short_name": "msfjarvis.website",
"description": "Thoughts and ramblings of a young software developer",
"start_url": "/posts",
"display": "standalone",
"background_color": "#292a2d",
"theme_color": "#a9a9b3",
"icons": [{
"src": "favicon-16x16.png",
"sizes": "16x16",
"type": "image/png"
},
{
"src": "favicon-32x32.png",
"sizes": "32x32",
"type": "image/png"
}]
}
"icons": [
{
"src": "favicon-16x16.png",
"sizes": "16x16",
"type": "image/png"
},
{
"src": "favicon-32x32.png",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
}
]
}

View File

@ -1 +0,0 @@
self.addEventListener('fetch', (event) => {});

View File

@ -6,12 +6,6 @@
<meta name="keywords" content="{{ .Site.Params.keywords }}" />
<meta name="robots" content="noodp" />
<link rel="canonical" href="{{ .Permalink }}" />
<script>
if ('serviceWorker' in navigator) {
// sw.js can literally be empty, but must exist
navigator.serviceWorker.register('/sw.js');
}
</script>
{{ block "title" . }}
<title>
@ -30,8 +24,7 @@ if ('serviceWorker' in navigator) {
<script src="https://assets.digitalclimatestrike.net/widget.js" async></script>
<!-- PWA -->
<link rel="manifest" href="manifest.webmanifest" />
<script src="https://cdn.jsdelivr.net/npm/pwacompat@2.0.9/pwacompat.min.js" integrity="sha384-VcI6S+HIsE80FVM1jgbd6WDFhzKYA0PecD/LcIyMQpT4fMJdijBh0I7Iblaacawc" crossorigin="anonymous" async></script>
<meta name="msapplication-TileColor" content="#2b5797">
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Minify | resources.Fingerprint }}