1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-24 01:42:10 +00:00

Metadata: description + cache-bust manifest icons

- Add a cache-busting fingerprint to all the icons in the webmanifest
- Add a <meta> and open graph tag for a description.
- Include a 512px icon in the manifest
This commit is contained in:
Rohan Kumar 2020-12-19 13:52:24 -08:00
parent ac0ced6aac
commit b9e4be50f5
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
10 changed files with 40 additions and 16 deletions

1
assets/favicon.svg Symbolic link
View file

@ -0,0 +1 @@
../static/favicon.svg

BIN
assets/favicon512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -1,25 +1,36 @@
{{- $192png := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" }}
{{- $512png := resources.Get "/favicon512.png" | resources.Fingerprint "md5" }}
{{- $1024svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" }}
{{- $maskablesvg := resources.Get "/maskable_android.svg" | resources.Fingerprint "md5" -}}
{
"name": "Seirdy's Home",
"short_name": "Seirdy",
"description": "{{ .Site.Params.Description }}",
"display": "browser",
"scope": "/",
"start_url": ".",
"start_url": "/",
"icons": [
{
"src": "https://seirdy.one/apple-touch-icon.png",
"src": "{{ $192png.Permalink }}",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "https://seirdy.one/favicon.svg",
"sizes": "1024x1024",
"src": "{{ $512png.Permalink }}",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "{{ $1024svg.Permalink }}",
"sizes": "1024x1024 512x512 384x384 192x192 180x180 152x152",
"type": "image/svg+xml",
"purpose": "any"
},
{
"src": "https://seirdy.one/maskable_android.svg",
"sizes": "1024x1024",
"src": "{{ $maskablesvg.Permalink }}",
"sizes": "1024x1024 512x512 384x384 192x192 180x180 152x152",
"type": "image/svg+xml",
"purpose": "maskable"
}

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -10,7 +10,7 @@ pygmentsCodeFences = true
pygmentsUseClasses = true
[params]
description = "Seirdy's Home"
description = "Seirdy's Home: personal website and blog for Rohan Kumar, A.K.A. Seirdy"
src = "https://sr.ht/~seirdy/seirdy.one"
copyright = "Copyright © 2020 Rohan Kumar"
dark = "auto"

View file

@ -1,5 +1,7 @@
---
date: "2020-11-17T13:13:03-08:00"
description: A seires on setting up resilient git-based project workflows, free of
vendor lock-in.
outputs:
- html
- gemtext
@ -40,7 +42,8 @@ project's "bus factor".
Providing a way to get everything offline, in a format that won't go obsolete if a
project dies, is the key to a resilient git workflow.
## Before we start: FAQ
Before we start: FAQ
--------------------
Q: What level of experience does this series expect?

View file

@ -1,5 +1,6 @@
---
date: "2020-11-18T18:31:15-08:00"
description: Efficient redundancy via repository mirroring with nothing but git.
outputs:
- html
- gemtext
@ -30,7 +31,8 @@ reports, get code, or send patches? Do maintainers need to check multiple places
No. Of course not. A good distributed system should automatically keep its nodes in
sync to avoid the hassle of checking multiple places for updates.
## Adding remotes
Adding remotes
--------------
This process should pretty straightforward. You can run `git remote add` (see
`git-remote(1)`) or edit your repo's `.git/config` directly:
@ -51,7 +53,8 @@ If that's too much work--a perfectly understandable complaint--automating the pr
is trivial. Here's [an example from my
dotfiles](https://git.sr.ht/~seirdy/dotfiles/tree/master/Executables/shell-scripts/bin/git-remote-setup).
## Seamless pushing and pulling
Seamless pushing and pulling
----------------------------
Having multiple remotes is fine, but pushing to and fetching from all of them can be
slow. Two simple git aliases fix that:
@ -66,13 +69,15 @@ Now, `git pushall` and `git fetchall` will push to and fetch from all remotes in
parallel, respectively. Only one remote needs to be online for project members to
keep working.
## Advertising remotes
Advertising remotes
-------------------
I'd recommend advertising at least three remotes in your README: your personal
favorite and two determined by popularity. Tell users to run `git remote set-url` to
switch remote locations if one goes down.
## Before you ask...
Before you ask...
-----------------
Q: Why not use a cloud service to automate mirroring?

View file

@ -1,5 +1,7 @@
---
date: "2020-11-02T11:06:56-08:00"
description: Seirdy's obligatory inagural blog post, which is barely longer than this
description.
outputs:
- html
- gemtext

View file

@ -1,5 +1,7 @@
---
date: "2020-11-23T12:21:35-08:00"
description: A lengthy guide to making small sites that focus on content rather than
form.
outputs:
- html
- gemtext

View file

@ -1,9 +1,8 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ with .Site.Params.description -}}
<meta name="description" content="{{ . }}">
{{ end }}
<meta name="description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
<meta name="author" content="{{ .Site.Author.name }}">
{{- $icon_192 := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" -}}
{{ printf `<link rel="icon" sizes="192x192" href="%s" type="image/png">` $icon_192.RelPermalink | safeHTML }}
{{ $favicon := resources.Get "/favicon.png" | resources.Fingerprint "md5" -}}
@ -15,7 +14,7 @@
{{ $mask_icon := resources.Get "/mask_apple.svg" | resources.Fingerprint "md5" -}}
{{ printf `<link rel="mask-icon" href="%s" color="black">` $mask_icon.RelPermalink | safeHTML }}
<!-- webmanifest defines even more icons. This is getting ridiculous -->
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.Fingerprint "md5" -}}
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Fingerprint "md5" -}}
{{ printf `<link rel="manifest" href="%s">` $webmanifest.RelPermalink | safeHTML }}
<link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}posts/index.xml" title="{{ $.Site.Title }}">
{{ if eq .Site.BaseURL "https://envs.net/~seirdy/" -}}
@ -62,4 +61,5 @@
<meta property="og:image:height" content="630">
<meta property="og:image:width" content="1200">
<meta property="og:url" content="https://seirdy.one{{ .RelPermalink }}">
<meta property="og:description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
</head>