1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 12:52:10 +00:00

Compare commits

...

8 commits

Author SHA1 Message Date
Rohan Kumar
cf17e0c1be
generalize vnu filter for xhtml to all xhtml files 2024-01-30 20:04:40 -05:00
Rohan Kumar
b18917ab83
Fix outdated webmanifest path 2024-01-30 19:57:31 -05:00
Rohan Kumar
04d6aacd0b
update v.nu filter 2024-01-30 19:38:12 -05:00
Rohan Kumar
723bdb5a5d
Add cdata to style tag 2024-01-30 18:50:37 -05:00
Rohan Kumar
4e192084b2
Fix off-by-one for codeindex 2024-01-30 18:50:04 -05:00
Rohan Kumar
b1c5584679
Fingerprint webmanifest with FNV32a instead of md5 2024-01-30 18:02:00 -05:00
Rohan Kumar
bf8aadf8bb
Update for Hugo 0.123
- Stop using symlinks for template files, since those seem to have
  broken.
- Force int data type for scratchpad integers since type inference seems
  to have changed.
2024-01-30 17:44:23 -05:00
Rohan Kumar
4c1ca8ffa4
Update TLS compatibility with SerenityOS LibTLS 2024-01-30 17:08:09 -05:00
15 changed files with 65 additions and 49 deletions

View file

@ -59,7 +59,7 @@ equal-access:
.PHONY: validate-json
validate-json:
jaq -re '""' $(OUTPUT_DIR)/manifest.min.*.webmanifest 1>/dev/null
jaq -re '""' $(OUTPUT_DIR)/manifest.*.webmanifest 1>/dev/null
jaq -re '""' $(OUTPUT_DIR)/webfinger.json 1>/dev/null
.PHONY: validate-html

View file

@ -98,7 +98,7 @@ Mainstream engine forks
: Pale Moon and recent versions of K-Meleon use Goanna, a single-process fork of Firefox's Gecko engine. Ultralight is a proprietary, source-available fork of WebKit focused on lightweight embedded webviews. My site works in these engines without any noticeable issues.
Alternative engines
: I test compatibility with current alternative engines: the SerenityOS browser, Servo, NetSurf, Kristall, and litehtml. I have excellent compatibility with litehtml and Servo. The site is usable in NetSurf, and the SerenityOS browser. Servo is the only engine in this category with support for `<details>`. [The SerenityOS browser lacks ECDSA certificate support](https://github.com/SerenityOS/serenity/issues/14160), but the Tildeverse mirror works fine. The SerenityOS browser also has issues displaying my inline SVG avatar.
: I test compatibility with current alternative engines: the SerenityOS browser, Servo, NetSurf, Kristall, and litehtml. I have excellent compatibility with litehtml and Servo. The site is usable in NetSurf, and the SerenityOS browser. Servo is the only engine in this category with support for `<details>`. ~~[The SerenityOS browser lacks ECDSA certificate support](https://github.com/SerenityOS/serenity/issues/14160), but the Tildeverse mirror works fine.~~ <ins itemprop="correction" itemscope="" itemtype="https://schema.org/CorrectionComment" cite="https://github.com/SerenityOS/serenity/commit/f9386737a631b5f3b7eb1920bd4440a2784359e9">Update <time itemprop="datePublished">2024-01-30</time>: <span itemprop="text">[SerenityOS LibTLS merged support for these ciphers in October 2023](https://github.com/SerenityOS/serenity/commit/f9386737a631b5f3b7eb1920bd4440a2784359e9), resolving this incompatibility</span></ins>. The SerenityOS browser also has issues displaying my inline SVG avatar.
Textual browsers
: The site works well with textual browsers. All features except `<details>` work in Lynx and Links2. I include [felinks (an ELinks fork)](https://github.com/rkd77/elinks), edbrowse, and w3m in my tests. [w3m doesn't support soft hyphens](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=830173), but the site is still otherwise usable in it. I support these engines by making CSS a strictly-optional progressive enhancement and by using semantic markup. I test with Edbrowse less often. No textual browser supports `<details>`.

View file

@ -12,7 +12,7 @@ Fediverse moderation
: I moderate the pleroma.envs.net Akkoma server as [@Seirdy@pleroma.envs.net](https://pleroma.envs.net/Seirdy "{rel='me'}"), and [I curate some blocklists]({{<relref "/posts/fediverse-blocklists.md">}}). This includes FediNuke; including supersets that include it, this is likely the most popular blocklist across the Fediverse.
Blogging
: See [the "Articles" section]({{<relref "/posts/">}}) for long-form articles, or [the "Notes" section]({{<relref "/notes/">}}) for short-form microblogs.
: See [the "Articles" section]({{<relref "/posts/_index.md">}}) for long-form articles, or [the "Notes" section]({{<relref "/notes/_index.md">}}) for short-form microblogs.
Coding
: Not much of that in public right now, but more are on the way (including the programs that generate my blocklists).

View file

@ -19,8 +19,12 @@
<link href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}" rel="canonical" />
<link href="{{ .Site.Params.WebmentionEndpoint }}" rel="webmention" />
<link href="{{ printf `https://webmention.io/webmention?forward=%s` .Site.Params.WebmentionEndpoint}}" rel="pingback" />
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify | resources.Fingerprint "md5" -}}
{{- printf `<link href="%s" rel="manifest" />` $webmanifest.RelPermalink | safeHTML -}}
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify -}}
{{- $cacheBuster := $webmanifest.Content | crypto.FNV32a -}}
{{- $webmanifestFingerprinted := printf "/manifest.%d.webmanifest" $cacheBuster -}}
{{- with resources.Copy $webmanifestFingerprinted $webmanifest -}}
{{- printf `<link href="%s" rel="manifest" />` .RelPermalink | safeHTML -}}
{{- end -}}
<!--Feeds for both notes and articles; articles come first unless we're in the notes section.-->
{{- if or (eq .Section "notes") (eq .Title "Notes") -}}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />

View file

@ -1 +0,0 @@
../shortcodes/indieweb-author.html

View file

@ -0,0 +1,26 @@
<!-- re-using the favicon for the author photo
Reader mode implementations use .p-author, itemprop=author, and/or .author to add
a byline. Some also strip elements matching the "byline" class to avoid duplicating
the byline. Mozilla Readability uses both microformats1 and microformats2 while
Chromium Distiller uses microdata + schema.org. This site also needs to be Indieweb
compatible for webmentions and such. To support them all, I ended up with
microdata, microformats2, microformats1, and the "byline" class.
I put the byline class around the html that includes this partial so it can hide
the whole line.
Jesus christ.
Abominations like this also appear elsewhere in the blog btw. This is just the best
example. Oh, and then i need to support some parts of hNews as well as hentry *and*
h-entry.
This would be so much simpler if all the parsers just had a mode to detect
schema.org and a mode to detect microformats2, and then stuck to those standards.
(btw this is all made of <span> cuz it is supposed to be inline)
--><span itemprop="author copyrightHolder" itemscope="" itemtype="https://schema.org/Person" itemid="https://seirdy.one/#seirdy" class="h-card p-author author vcard">
<a itemprop="url" href="https://seirdy.one/" rel="author me home cc:attributionURL" class="u-url u-uid url" property="cc:attributionName">
{{ partialCached "indieweb-icon.html" . -}} <span itemprop="name" class="p-name fn n">
<span itemprop="givenName" class="p-given-name given-name">Rohan</span><span itemprop="additionalName" class="p-additional-name additional-name">Seirdy</span><span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>
</span>{{- /* no line break */ -}}

View file

@ -1 +0,0 @@
../shortcodes/indieweb-icon.html

View file

@ -0,0 +1,10 @@
{{- $src := "" -}}
{{- if in site.BaseURL ".onion" -}}
{{- $favicon := resources.Get "/favicon.png" -}}
{{- $favicon_base64 := $favicon.Content | base64Encode -}}
{{- $src = printf "data:image/png;base64,%s" $favicon_base64 -}}
{{- else -}}
{{- with (partialCached "cache-bust.html" "/favicon.svg" "/favicon.svg") -}}
{{- $src = .Permalink -}}
{{- end -}}{{- end -}}
<img itemprop="image" width="16" height="16" alt="" src="{{ $src }}" class="u-photo photo" />

View file

@ -1,8 +1,5 @@
{{- define "main" -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{- .Scratch.Set "codeIndex" 1 -}}
{{- .Scratch.Set "codeIndexAtom" 1 -}}
{{- .Scratch.Set "codeIndexRss" 1 -}}
<main
itemprop="mainEntity" itemscope="" itemtype="https://schema.org/BlogPosting{{ with .Params.articleType }} https://schema.org/{{ . }}{{ end }}" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" />

View file

@ -1,4 +1,5 @@
{{- $codeIndex := (.Page.Scratch.Get "codeIndexAtom") -}}
{{- .Page.Scratch.Add "codeIndexAtom" 1 -}}
{{- $codeIndex := (int (.Page.Scratch.Get "codeIndexAtom")) -}}
{{- $id := (printf `code-%d` $codeIndex) -}}
{{- with .Get "id" -}}
{{- $id = . -}}
@ -14,4 +15,3 @@
</span>:
{{ .Inner | .Page.RenderString | safeHTML }}
</figcaption>
{{- .Page.Scratch.Set "codeIndexAtom" (add 1 $codeIndex) -}}

View file

@ -1,4 +1,5 @@
{{- $codeIndex := (.Page.Scratch.Get "codeIndex") -}}
{{- .Page.Scratch.Add "codeIndex" 1 -}}
{{- $codeIndex := (int (.Page.Scratch.Get "codeIndex")) -}}
{{- $id := (printf `code-%d` $codeIndex) -}}
{{- with .Get "id" -}}
{{- $id = . -}}
@ -14,4 +15,3 @@
</span>:
{{ .Inner | .Page.RenderString | safeHTML }}
</figcaption>
{{- .Page.Scratch.Set "codeIndex" (add 1 $codeIndex) -}}

View file

@ -1,4 +1,5 @@
{{- $codeIndex := (.Page.Scratch.Get "codeIndexRss") -}}
{{- .Page.Scratch.Add "codeIndexRss" 1 -}}
{{- $codeIndex := (int (.Page.Scratch.Get "codeIndexRss")) -}}
{{- $id := (printf `code-%d` $codeIndex) -}}
{{- with .Get "id" -}}
{{- $id = . -}}
@ -14,4 +15,3 @@
</span>:
{{ .Inner | .Page.RenderString | safeHTML }}
</figcaption>
{{- .Page.Scratch.Set "codeIndexRss" (add 1 $codeIndex) -}}

View file

@ -1,5 +1,5 @@
{{- $codeIndex := (.Page.Scratch.Get "codeIndex") -}}
{{- $id := (printf `code-%d` (sub $codeIndex 1)) -}}
{{- $id := (printf `code-%d` $codeIndex) -}}
{{- with .Get "id" -}}
{{- $id = . -}}
{{- end -}}

View file

@ -1,26 +0,0 @@
<!-- re-using the favicon for the author photo
Reader mode implementations use .p-author, itemprop=author, and/or .author to add
a byline. Some also strip elements matching the "byline" class to avoid duplicating
the byline. Mozilla Readability uses both microformats1 and microformats2 while
Chromium Distiller uses microdata + schema.org. This site also needs to be Indieweb
compatible for webmentions and such. To support them all, I ended up with
microdata, microformats2, microformats1, and the "byline" class.
I put the byline class around the html that includes this partial so it can hide
the whole line.
Jesus christ.
Abominations like this also appear elsewhere in the blog btw. This is just the best
example. Oh, and then i need to support some parts of hNews as well as hentry *and*
h-entry.
This would be so much simpler if all the parsers just had a mode to detect
schema.org and a mode to detect microformats2, and then stuck to those standards.
(btw this is all made of <span> cuz it is supposed to be inline)
--><span itemprop="author copyrightHolder" itemscope="" itemtype="https://schema.org/Person" itemid="https://seirdy.one/#seirdy" class="h-card p-author author vcard">
<a itemprop="url" href="https://seirdy.one/" rel="author me home cc:attributionURL" class="u-url u-uid url" property="cc:attributionName">
{{ partialCached "indieweb-icon.html" . -}} <span itemprop="name" class="p-name fn n">
<span itemprop="givenName" class="p-given-name given-name">Rohan</span><span itemprop="additionalName" class="p-additional-name additional-name">Seirdy</span><span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>
</span>{{- /* no line break */ -}}

View file

@ -18,6 +18,12 @@
( # see https://github.com/w3c/css-validator/issues/370
.message == "CSS: “contain”: “inline-size” is not a “contain” value."
) or
( # See https://github.com/w3c/css-validator/issues/361
.message == "CSS: Parse Error."
and .extract == "not(:focus-visible){outline:no"
and (.url | test(".xhtml"))
and .hiliteLength == 1
) or
( # See https://github.com/w3c/css-validator/issues/361
.message == "CSS: Parse Error."
and .extract == "){outline:none}}@media(prefers"

View file

@ -40,7 +40,7 @@ run_xmllint() {
sed 7d "$html_file" | run_xmllint | tail -n +2 >"$tmp_file"
{
head -n7 "$tmp_file" | sed -e 's/^\t//'
cat "${OUTPUT_DIR:?}/tmp.css"
cat "${OUTPUT_DIR:?}/tmp.xhtml"
# shellcheck disable=SC2016 # these are regex statements, not shell expressions
#shellcheck source=/home/rkumar/Executables/ghq/git.sr.ht/~seirdy/seirdy.one/scripts/xhtmlize.sh
sed \

View file

@ -14,13 +14,14 @@ temp_resume="$(mktemp)"
# I have an alias for a redirect. I also define the redirect in Nginx, but this is there for the envs.net/~seirdy mirror. Hugo aliases don't have trailing slashes; this will trip up xmllint.
sed -i -e 's|<html lang="en-us"|<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"|' -E -e 's#<((link|meta) .*)">#<\1" />#' "$output_dir/resume/index.html"
mv "$output_dir/resume/index.html" "$temp_resume"
# {{ $css.Content | safeCSS }}/*]]>*/-->
{
sed -e '7q;d' "$output_dir/index.html"
} >"$output_dir/tmp.css"
sed -e '7q;d' "$output_dir/index.html" \
| sed -e 's|<style>|<style><\!--/\*--><\!\[CDATA\[/\*><\!--\*/|' -e 's|</style>|/\*\]\]>\*/--></style>|'
} >"$output_dir/tmp.xhtml"
cleanup() {
rm -f "$output_dir/tmp.css"
mv "$temp_resume" "$output_dir/resume/index.html"
rm "$output_dir/tmp.xhtml"
mv "$temp_resume" "$output_dir/resume/index.html"
}
trap cleanup EXIT