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

45 lines
2.3 KiB
HTML
Raw Normal View History

{{- $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" -}}
2022-05-25 00:28:32 +00:00
{{- end -}}
{{- $needsModTime := gt (sub .context.Lastmod.Unix .context.Date.Unix) 900 -}}
{{- $needsList := or (and (not $shortMeta) $needsModTime) (not $isNotes) -}}
2023-11-03 16:47:06 +00:00
{{- $gemini := "" }}
{{- with .context.OutputFormats.Get "gemtext" -}}
2023-11-03 16:47:06 +00:00
{{- $gemini = replace .Permalink "/gemini" "" 1 | safeURL -}}
{{- end -}}
{{- if not (eq .context.Page.Section "posts" ) -}}
2023-11-03 16:47:06 +00:00
{{- $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="canonical" 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 }}
2022-06-02 04:00:19 +00:00
{{- end -}}
{{- if not $isNotes -}}
{{ if $needsList }}<li>{{ else }}<br />{{ end }}
{{ partial "post-meta/wordcount.html" .context -}}
{{ if $needsList }}</li>{{ end }}
2022-06-02 04:49:04 +00:00
{{- end -}}
{{- if $needsList }}
</ul>
{{- else}}
</p>
{{- end }}