From b9e4be50f5e2b543df8e834ff2bc7893e084fd09 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Sat, 19 Dec 2020 13:52:24 -0800 Subject: [PATCH] Metadata: description + cache-bust manifest icons - Add a cache-busting fingerprint to all the icons in the webmanifest - Add a and open graph tag for a description. - Include a 512px icon in the manifest --- assets/favicon.svg | 1 + assets/favicon512.png | Bin 0 -> 2261 bytes assets/manifest.webmanifest | 23 +++++++++++++----- {static => assets}/maskable_android.svg | 0 config.toml | 2 +- content/posts/git-workflow-0.md | 5 +++- content/posts/git-workflow-1.md | 13 +++++++--- content/posts/hello-world.md | 2 ++ content/posts/website-best-practices.md | 2 ++ themes/etch-custom/layouts/partials/head.html | 8 +++--- 10 files changed, 40 insertions(+), 16 deletions(-) create mode 120000 assets/favicon.svg create mode 100644 assets/favicon512.png rename {static => assets}/maskable_android.svg (100%) diff --git a/assets/favicon.svg b/assets/favicon.svg new file mode 120000 index 0000000..e8aa45f --- /dev/null +++ b/assets/favicon.svg @@ -0,0 +1 @@ +../static/favicon.svg \ No newline at end of file diff --git a/assets/favicon512.png b/assets/favicon512.png new file mode 100644 index 0000000000000000000000000000000000000000..5251366f81970c215850303c9b7c4706b968cf1f GIT binary patch literal 2261 zcmbW1dpOe#8^?cUlH+2ec#u4MC`rYloJLblEis$ZWV2=EDEPT?SzD4@ zuJF$BmUWh4W1Bk3Oz066O?nsBA_q@4J}i3dp#!e($fw=@EF0KSV)S-|{)hNWF#H3L zNzHhXIaFEDlU|qmHChZl-a(Ikd^YLMr!F0?tC1<<1D25f&Pfalwl{(SqSGOkg4WpzkFG-!^*onsCsNOVsn0*B3vY7lO@QQ zaP_uS7SE>Ym7}8G>lUj0c7((VFSMJ`${-W9eFaa-!C;6j$`oRQL^ya||*o(LM zOuUo}Dk&gxuN9O#-aV7;KNmqQeC2EPGuzEkf!_GtL)&I}l2(VwmW-tK8|*$Lcf%HJ z0{uan@XG&rt+$G)uaO*!5~f6A!Yt~sx+4fC6F!g1U)c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W q$26!|XsrN$y8iEe`A_2z*ff#Uq?@$zSvlykY$#H*na`VCny&H literal 0 HcmV?d00001 diff --git a/assets/manifest.webmanifest b/assets/manifest.webmanifest index a741e2a..5cfdaf0 100644 --- a/assets/manifest.webmanifest +++ b/assets/manifest.webmanifest @@ -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" } diff --git a/static/maskable_android.svg b/assets/maskable_android.svg similarity index 100% rename from static/maskable_android.svg rename to assets/maskable_android.svg diff --git a/config.toml b/config.toml index 1d0a07f..df607e0 100644 --- a/config.toml +++ b/config.toml @@ -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" diff --git a/content/posts/git-workflow-0.md b/content/posts/git-workflow-0.md index 9fefaf3..2a44846 100644 --- a/content/posts/git-workflow-0.md +++ b/content/posts/git-workflow-0.md @@ -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? diff --git a/content/posts/git-workflow-1.md b/content/posts/git-workflow-1.md index 8ad94ad..611bd6d 100644 --- a/content/posts/git-workflow-1.md +++ b/content/posts/git-workflow-1.md @@ -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? diff --git a/content/posts/hello-world.md b/content/posts/hello-world.md index 1bef0ba..d2f6176 100644 --- a/content/posts/hello-world.md +++ b/content/posts/hello-world.md @@ -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 diff --git a/content/posts/website-best-practices.md b/content/posts/website-best-practices.md index 147ceac..162e62b 100644 --- a/content/posts/website-best-practices.md +++ b/content/posts/website-best-practices.md @@ -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 diff --git a/themes/etch-custom/layouts/partials/head.html b/themes/etch-custom/layouts/partials/head.html index 270657a..4d77022 100644 --- a/themes/etch-custom/layouts/partials/head.html +++ b/themes/etch-custom/layouts/partials/head.html @@ -1,9 +1,8 @@ - {{ with .Site.Params.description -}} - - {{ end }} + + {{- $icon_192 := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" -}} {{ printf `` $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 `` $mask_icon.RelPermalink | safeHTML }} - {{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.Fingerprint "md5" -}} + {{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Fingerprint "md5" -}} {{ printf `` $webmanifest.RelPermalink | safeHTML }} {{ if eq .Site.BaseURL "https://envs.net/~seirdy/" -}} @@ -62,4 +61,5 @@ +