mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-18 06:42:10 +00:00
19d5fe2b00
Use partialCached to avoid any perf penalty. TODO: limit the scope I pass to them. I noticed a teeny tiny perf improvement after doing this, probably because now some giant data structures only need to be generated once.
44 lines
2.1 KiB
HTML
44 lines
2.1 KiB
HTML
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
|
|
{{- $isNotes := false -}}
|
|
{{- $action := "Posted" -}}
|
|
{{- $shortMeta := false -}}
|
|
{{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path -}}
|
|
{{- if .Scratch.Get "shortMeta" -}}
|
|
{{- $shortMeta = true -}}
|
|
{{- end -}}
|
|
{{- if or (eq .Page.Section "notes") (eq .Page.Title "Notes") -}}
|
|
{{- $isNotes = true -}}
|
|
{{- $action = "Noted" -}}
|
|
{{- end -}}
|
|
{{- $needsModTime := gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
|
|
{{- $needsList := or (and (not $shortMeta) $needsModTime) (not $isNotes) -}}
|
|
{{- $gemini := "" }}
|
|
{{- with .OutputFormats.Get "gemtext" -}}
|
|
{{- $gemini = replace .Permalink "/gemini" "" 1 | safeURL -}}
|
|
{{- end -}}
|
|
{{- if not (eq .Page.Section "posts" ) -}}
|
|
{{- $gemini = replace $gemini "/index.gmi" ".gmi" | safeURL -}}
|
|
{{- end -}}
|
|
{{- if $needsList }}
|
|
<ul>
|
|
{{- else}}
|
|
<p>
|
|
{{- end }}
|
|
{{ if $needsList }}<li>{{ end }}
|
|
{{- $action }} <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> by {{ partial "indieweb-author.html" -}}{{ if not $shortMeta }} on his <a rel="canonical" itemprop="url" class="u-url url" href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and <a rel="syndication" class="u-syndication" href="{{ $gemini }}">Gemini capsule</a>{{ end }}{{- end -}}.
|
|
{{ if $needsList }}</li>{{ end }}
|
|
{{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
|
|
{{ if $needsList }}<li>{{ end }}
|
|
Last updated <time itemprop="dateModified" class="dt-updated updated" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>.{{ if not $shortMeta }} <a href="{{ $logURL }}">Changelog</a>{{ end }}
|
|
{{ if $needsList }}</li>{{ end }}
|
|
{{- end -}}
|
|
{{- if not $isNotes -}}
|
|
{{ if $needsList }}<li>{{ else }}<br />{{ end }}
|
|
{{ partial "post-meta/wordcount.html" . -}}
|
|
{{ if $needsList }}</li>{{ end }}
|
|
{{- end -}}
|
|
{{- if $needsList }}
|
|
</ul>
|
|
{{- else}}
|
|
</p>
|
|
{{- end }}
|