1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-25 18:22:09 +00:00
seirdy.one/layouts/partials/post-meta/post-meta.html
2024-04-22 01:01:20 -04:00

44 lines
2.3 KiB
HTML

{{- $canonicalRelPermalink := .context.RelPermalink | replaceRE "^/~seirdy/" "/" -}}
{{- $isNotes := false -}}
{{- $action := "Posted" -}}
{{- $shortMeta := false -}}
{{- $logURL := printf "%scontent/%s" .context.Site.Params.logUrlPrefix .context.File.Path -}}
{{- if .context.Scratch.Get "shortMeta" -}}
{{- $shortMeta = true -}}
{{- end -}}
{{- if or (eq .context.Page.Section "notes") (eq .context.Page.Title "Notes") -}}
{{- $isNotes = true -}}
{{- $action = "Noted" -}}
{{- end -}}
{{- $needsModTime := gt (sub .context.Lastmod.Unix .context.Date.Unix) 900 -}}
{{- $needsList := or (and (not $shortMeta) $needsModTime) (not $isNotes) -}}
{{- $gemini := "" }}
{{- with .context.OutputFormats.Get "gemtext" -}}
{{- $gemini = replace .Permalink "/gemini" "" 1 | safeURL -}}
{{- end -}}
{{- if not (eq .context.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 (.context.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .context.Date.UTC.Format "2006-01-02T15:04:05Z07:00" }}">{{ .context.Date.UTC.Format "2006-01-02" }}</time> by {{ partialCached "indieweb-author.html" .context -}}{{ if not .isList }} on his <a rel="bookmark" itemprop="url" class="u-url url" href="{{ .context.Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .context.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 .context.Lastmod.Unix .context.Date.Unix) 900 -}}
{{ if $needsList }}<li>{{ end }}
Last updated <time itemprop="dateModified" class="dt-updated updated" datetime="{{ .context.Lastmod.UTC.Format "2006-01-02T15:04:05Z07:00" }}">{{ .context.Lastmod.UTC.Format "2006-01-02" }}</time>.{{ if not .isList }} <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" .context -}}
{{ if $needsList }}</li>{{ end }}
{{- end -}}
{{- if $needsList }}
</ul>
{{- else}}
</p>
{{- end }}