diff --git a/.build.yml b/.build.yml index 60e3e25..718df0e 100644 --- a/.build.yml +++ b/.build.yml @@ -1,9 +1,13 @@ --- +# we rsync binaries.tar.gz from the same server we deploy to. +# it contains these static-pie binaries: +# hugo, brotli, ect (like gzip/zopfli), sd, and xmlfmt. image: alpine/edge packages: - rsync - git # for Hugo's gitInfo - bmake + - moreutils sources: - https://git.sr.ht/~seirdy/seirdy.one secrets: diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 35d2344..d49121f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,83 +1,80 @@ - -{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }} - -{{ if or (eq site.BaseURL site.Params.CanonicalBaseURL) (in site.BaseURL "wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion") -}} - -{{ end -}} - - -{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify | resources.Fingerprint "md5" -}} -{{- printf `` $webmanifest.RelPermalink | safeHTML -}} - -{{- $isNotes := false -}} -{{- if or (eq .Section "notes") (eq .Title "Notes") -}} -{{- $isNotes = true -}} - -{{- end }} - -{{ if not $isNotes -}} - -{{- end }} -{{ .Title }}{{ if and (lt (len .Title) 54) (ne $canonicalRelPermalink "/") }} - Seirdy{{ end }} -{{ $description := .Site.Params.Description -}} -{{- if .Params.description -}} - {{- $description = .Params.Description -}} -{{- else if .Summary -}} - {{- $description = .Summary | replaceRE `\n` ` ` | replaceRE `\’` `’` | replaceRE `\ ` `\ ` | replaceRE `\“` `“` | replaceRE `\”` `”` | replaceRE `\…` `—` | replaceRE `\—` `—` | replaceRE `\­` `\­` | replaceRE `‘` `‘` | safeHTML -}} -{{- end -}} - - - -{{ if and (gt .Date 0) (not .Params.evergreen) -}} - -{{ end -}} -{{ if lt .Date .Lastmod -}} - -{{- end -}} - -{{ if not (in site.BaseURL ".onion") -}} -{{ $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" }} -{{- printf `` $icon_svg.RelPermalink | safeHTML }} -{{- end }} -{{ $icon_192 := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" }} -{{- printf `` $icon_192.RelPermalink | safeHTML -}} -{{ $favicon := resources.Get "/favicon.png" -}} -{{ $favicon_base64 := $favicon.Content | base64Encode }} -{{ printf `` $favicon_base64 | safeHTML }} - - - - - -{{- $resources := slice -}} -{{- $resources = $resources | append (resources.Get "/css/main.css") -}} -{{ $dark := .Site.Params.dark | default "auto" -}} -{{- if not (eq $dark "off") -}} -{{ $resources = $resources | append (resources.Get "css/dark.css" | resources.ExecuteAsTemplate "dark.css" .) -}} -{{- end -}} -{{ $resources = $resources | append (resources.Get "css/print.css" | resources.ExecuteAsTemplate "print.css" .) -}} -{{- $css := $resources | resources.Concat "css/style.css" | minify -}} - - - -{{- if not (or (ne "page" .Kind) (eq $canonicalRelPermalink "/bookmarks/") (eq $canonicalRelPermalink "/posts/")) }} - -{{- end -}} - -{{- $og_image := resources.Get "/favicon512.png" | resources.Fingerprint "md5" -}} -{{- $og_image_alt := "" -}} -{{- with .Params.image -}} - {{- $og_image = resources.Get (printf "/p/%s" . ) | resources.Fingerprint "md5" -}} -{{- end -}} -{{- with .Params.image_alt -}} - {{- $og_image_alt = . -}} -{{- end }} -{{ printf `` $og_image.Permalink | safeHTML }} - - - - - -{{ hugo.Generator }} + + {{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }} + + {{ if or (eq site.BaseURL site.Params.CanonicalBaseURL) (in site.BaseURL "wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion") -}} + + {{ end -}} + + + {{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify | resources.Fingerprint "md5" -}} + {{- printf `` $webmanifest.RelPermalink | safeHTML -}} + + {{- $isNotes := false -}} + {{- if or (eq .Section "notes") (eq .Title "Notes") -}} + {{- $isNotes = true -}} + + {{- end }} + + {{ if not $isNotes -}} + + {{- end }} + {{ .Title }}{{ if and (lt (len .Title) 54) (ne $canonicalRelPermalink "/") }} - Seirdy{{ end }} + {{ $description := .Site.Params.Description -}} + {{- if .Params.description -}} + {{- $description = .Params.Description -}} + {{- else if .Summary -}} + {{- $description = .Summary | replaceRE `\n` ` ` | replaceRE `\’` `’` | replaceRE `\ ` `\ ` | replaceRE `\“` `“` | replaceRE `\”` `”` | replaceRE `\…` `—` | replaceRE `\—` `—` | replaceRE `\­` `\­` | replaceRE `‘` `‘` | safeHTML -}} + {{- end -}} + + + + {{ if and (gt .Date 0) (not .Params.evergreen) -}} + + {{ end -}} + {{ if lt .Date .Lastmod -}} + + {{- end -}} + + {{ if not (in site.BaseURL ".onion") -}} + {{ $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" }} + {{- printf `` $icon_svg.RelPermalink | safeHTML }} + {{- end }} + {{ $icon_192 := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" }} + {{- printf `` $icon_192.RelPermalink | safeHTML -}} + + + + + + {{- $resources := slice -}} + {{- $resources = $resources | append (resources.Get "/css/main.css") -}} + {{ $dark := .Site.Params.dark | default "auto" -}} + {{- if not (eq $dark "off") -}} + {{ $resources = $resources | append (resources.Get "css/dark.css" | resources.ExecuteAsTemplate "dark.css" .) -}} + {{- end -}} + {{ $resources = $resources | append (resources.Get "css/print.css" | resources.ExecuteAsTemplate "print.css" .) -}} + {{- $css := $resources | resources.Concat "css/style.css" | minify -}} + + + + {{- if not (or (ne "page" .Kind) (eq $canonicalRelPermalink "/bookmarks/") (eq $canonicalRelPermalink "/posts/")) }} + + {{- end -}} + + {{- $og_image := resources.Get "/favicon512.png" | resources.Fingerprint "md5" -}} + {{- $og_image_alt := "" -}} + {{- with .Params.image -}} + {{- $og_image = resources.Get (printf "/p/%s" . ) | resources.Fingerprint "md5" -}} + {{- end -}} + {{- with .Params.image_alt -}} + {{- $og_image_alt = . -}} + {{- end }} + {{ printf `` $og_image.Permalink | safeHTML }} + + + + + + {{ hugo.Generator }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 997d539..415cbc5 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,36 +1,36 @@ -
- -
+
+ +
diff --git a/layouts/partials/webmentions.html b/layouts/partials/webmentions.html index cb97d86..e1da4e5 100644 --- a/layouts/partials/webmentions.html +++ b/layouts/partials/webmentions.html @@ -55,5 +55,5 @@
This post does not have any approved Webmentions yet.
{{- end }} -

+

Feel free to contact me directly with feedback; here’s my contact info

diff --git a/scripts/xhtmlize.sh b/scripts/xhtmlize.sh index d7cd4eb..8fe1261 100644 --- a/scripts/xhtmlize.sh +++ b/scripts/xhtmlize.sh @@ -5,7 +5,8 @@ # XML tooling. # this means that every index.html file has an equivalent index.xhtml file. # content negotiation allows an agent to pick html or xhtml. +# echo "" find "$1" -type f -name '*.html' \ - -exec sh -c 'echo "" | cat - "$0" | grep -Fv "" >"${0%*.html}.xhtml"' {} \; + -exec sh -c 'echo "" >"${0%*.html}.xhtml" && xmlfmt -i " " -f "$0" | busybox sed -e :a -e "/./,\$!d;/^\n*\$/{\$d;N;};/\n\$/ba" | sd -f m "\n(?:\t*)?\n\t*>\"${0%*.html}.xhtml\"" "sponge \"$0\""' {} \; # done