mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 12:52:10 +00:00
Compare commits
8 commits
0516b4c124
...
cf17e0c1be
Author | SHA1 | Date | |
---|---|---|---|
|
cf17e0c1be | ||
|
b18917ab83 | ||
|
04d6aacd0b | ||
|
723bdb5a5d | ||
|
4e192084b2 | ||
|
b1c5584679 | ||
|
bf8aadf8bb | ||
|
4c1ca8ffa4 |
15 changed files with 65 additions and 49 deletions
2
Makefile
2
Makefile
|
@ -59,7 +59,7 @@ equal-access:
|
||||||
|
|
||||||
.PHONY: validate-json
|
.PHONY: validate-json
|
||||||
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
|
jaq -re '""' $(OUTPUT_DIR)/webfinger.json 1>/dev/null
|
||||||
|
|
||||||
.PHONY: validate-html
|
.PHONY: validate-html
|
||||||
|
|
|
@ -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.
|
: 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
|
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
|
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>`.
|
: 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>`.
|
||||||
|
|
|
@ -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.
|
: 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
|
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
|
Coding
|
||||||
: Not much of that in public right now, but more are on the way (including the programs that generate my blocklists).
|
: Not much of that in public right now, but more are on the way (including the programs that generate my blocklists).
|
||||||
|
|
|
@ -19,8 +19,12 @@
|
||||||
<link href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}" rel="canonical" />
|
<link href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}" rel="canonical" />
|
||||||
<link href="{{ .Site.Params.WebmentionEndpoint }}" rel="webmention" />
|
<link href="{{ .Site.Params.WebmentionEndpoint }}" rel="webmention" />
|
||||||
<link href="{{ printf `https://webmention.io/webmention?forward=%s` .Site.Params.WebmentionEndpoint}}" rel="pingback" />
|
<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" -}}
|
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify -}}
|
||||||
{{- printf `<link href="%s" rel="manifest" />` $webmanifest.RelPermalink | safeHTML -}}
|
{{- $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.-->
|
<!--Feeds for both notes and articles; articles come first unless we're in the notes section.-->
|
||||||
{{- if or (eq .Section "notes") (eq .Title "Notes") -}}
|
{{- if or (eq .Section "notes") (eq .Title "Notes") -}}
|
||||||
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />
|
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../shortcodes/indieweb-author.html
|
|
26
layouts/partials/indieweb-author.html
Normal file
26
layouts/partials/indieweb-author.html
Normal 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 */ -}}
|
|
@ -1 +0,0 @@
|
||||||
../shortcodes/indieweb-icon.html
|
|
10
layouts/partials/indieweb-icon.html
Normal file
10
layouts/partials/indieweb-icon.html
Normal 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" />
|
|
@ -1,8 +1,5 @@
|
||||||
{{- define "main" -}}
|
{{- define "main" -}}
|
||||||
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
||||||
{{- .Scratch.Set "codeIndex" 1 -}}
|
|
||||||
{{- .Scratch.Set "codeIndexAtom" 1 -}}
|
|
||||||
{{- .Scratch.Set "codeIndexRss" 1 -}}
|
|
||||||
<main
|
<main
|
||||||
itemprop="mainEntity" itemscope="" itemtype="https://schema.org/BlogPosting{{ with .Params.articleType }} https://schema.org/{{ . }}{{ end }}" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
|
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 }}/" />
|
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" />
|
||||||
|
|
|
@ -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) -}}
|
{{- $id := (printf `code-%d` $codeIndex) -}}
|
||||||
{{- with .Get "id" -}}
|
{{- with .Get "id" -}}
|
||||||
{{- $id = . -}}
|
{{- $id = . -}}
|
||||||
|
@ -14,4 +15,3 @@
|
||||||
</span>:
|
</span>:
|
||||||
{{ .Inner | .Page.RenderString | safeHTML }}
|
{{ .Inner | .Page.RenderString | safeHTML }}
|
||||||
</figcaption>
|
</figcaption>
|
||||||
{{- .Page.Scratch.Set "codeIndexAtom" (add 1 $codeIndex) -}}
|
|
||||||
|
|
|
@ -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) -}}
|
{{- $id := (printf `code-%d` $codeIndex) -}}
|
||||||
{{- with .Get "id" -}}
|
{{- with .Get "id" -}}
|
||||||
{{- $id = . -}}
|
{{- $id = . -}}
|
||||||
|
@ -14,4 +15,3 @@
|
||||||
</span>:
|
</span>:
|
||||||
{{ .Inner | .Page.RenderString | safeHTML }}
|
{{ .Inner | .Page.RenderString | safeHTML }}
|
||||||
</figcaption>
|
</figcaption>
|
||||||
{{- .Page.Scratch.Set "codeIndex" (add 1 $codeIndex) -}}
|
|
||||||
|
|
|
@ -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) -}}
|
{{- $id := (printf `code-%d` $codeIndex) -}}
|
||||||
{{- with .Get "id" -}}
|
{{- with .Get "id" -}}
|
||||||
{{- $id = . -}}
|
{{- $id = . -}}
|
||||||
|
@ -14,4 +15,3 @@
|
||||||
</span>:
|
</span>:
|
||||||
{{ .Inner | .Page.RenderString | safeHTML }}
|
{{ .Inner | .Page.RenderString | safeHTML }}
|
||||||
</figcaption>
|
</figcaption>
|
||||||
{{- .Page.Scratch.Set "codeIndexRss" (add 1 $codeIndex) -}}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{- $codeIndex := (.Page.Scratch.Get "codeIndex") -}}
|
{{- $codeIndex := (.Page.Scratch.Get "codeIndex") -}}
|
||||||
{{- $id := (printf `code-%d` (sub $codeIndex 1)) -}}
|
{{- $id := (printf `code-%d` $codeIndex) -}}
|
||||||
{{- with .Get "id" -}}
|
{{- with .Get "id" -}}
|
||||||
{{- $id = . -}}
|
{{- $id = . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -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 */ -}}
|
|
|
@ -18,6 +18,12 @@
|
||||||
( # see https://github.com/w3c/css-validator/issues/370
|
( # see https://github.com/w3c/css-validator/issues/370
|
||||||
.message == "CSS: “contain”: “inline-size” is not a “contain” value."
|
.message == "CSS: “contain”: “inline-size” is not a “contain” value."
|
||||||
) or
|
) 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
|
( # See https://github.com/w3c/css-validator/issues/361
|
||||||
.message == "CSS: Parse Error."
|
.message == "CSS: Parse Error."
|
||||||
and .extract == "){outline:none}}@media(prefers"
|
and .extract == "){outline:none}}@media(prefers"
|
||||||
|
|
|
@ -40,7 +40,7 @@ run_xmllint() {
|
||||||
sed 7d "$html_file" | run_xmllint | tail -n +2 >"$tmp_file"
|
sed 7d "$html_file" | run_xmllint | tail -n +2 >"$tmp_file"
|
||||||
{
|
{
|
||||||
head -n7 "$tmp_file" | sed -e 's/^\t//'
|
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 disable=SC2016 # these are regex statements, not shell expressions
|
||||||
#shellcheck source=/home/rkumar/Executables/ghq/git.sr.ht/~seirdy/seirdy.one/scripts/xhtmlize.sh
|
#shellcheck source=/home/rkumar/Executables/ghq/git.sr.ht/~seirdy/seirdy.one/scripts/xhtmlize.sh
|
||||||
sed \
|
sed \
|
||||||
|
|
|
@ -14,12 +14,13 @@ 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.
|
# 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"
|
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"
|
mv "$output_dir/resume/index.html" "$temp_resume"
|
||||||
|
# {{ $css.Content | safeCSS }}/*]]>*/-->
|
||||||
{
|
{
|
||||||
sed -e '7q;d' "$output_dir/index.html"
|
sed -e '7q;d' "$output_dir/index.html" \
|
||||||
} >"$output_dir/tmp.css"
|
| sed -e 's|<style>|<style><\!--/\*--><\!\[CDATA\[/\*><\!--\*/|' -e 's|</style>|/\*\]\]>\*/--></style>|'
|
||||||
|
} >"$output_dir/tmp.xhtml"
|
||||||
cleanup() {
|
cleanup() {
|
||||||
rm -f "$output_dir/tmp.css"
|
rm "$output_dir/tmp.xhtml"
|
||||||
mv "$temp_resume" "$output_dir/resume/index.html"
|
mv "$temp_resume" "$output_dir/resume/index.html"
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
Loading…
Reference in a new issue