mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-24 01:42:10 +00:00
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.
This commit is contained in:
parent
4c1ca8ffa4
commit
bf8aadf8bb
8 changed files with 43 additions and 38 deletions
|
@ -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).
|
||||
|
|
|
@ -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" -}}
|
||||
{{- $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 }}/" />
|
||||
|
|
|
@ -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) -}}
|
||||
|
|
|
@ -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) -}}
|
||||
|
|
|
@ -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) -}}
|
||||
|
|
|
@ -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 */ -}}
|
Loading…
Reference in a new issue