1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-24 01:42:10 +00:00

Fix changelogs for notes

This commit is contained in:
Rohan Kumar 2022-05-24 17:28:32 -07:00
parent d123bd9a12
commit b6cec919ab
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -1,12 +1,16 @@
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path }}
{{ $isNote := (eq .Page.Section "notes") -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
{{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path -}}
{{- if not $isNote -}}
{{- $logURL = $logURL | strings.ReplaceRE `\.md` `.gmi` -}}
{{- end -}}
Posted <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" -}} on his <a rel="canonical" itemprop="mainEntityOfPage 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="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>{{- end -}}.
{{ if lt .Date .Lastmod -}}
<br>
Last updated <time itemprop="dateModified" class="dt-updated updated" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ $logURL | strings.ReplaceRE `\.md` `.gmi` }}">Changelog</a>.
Last updated <time itemprop="dateModified" class="dt-updated updated" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ $logURL }}">Changelog</a>.
{{- end }}
{{ if not (eq .Page.Section "notes") -}}
{{ if not $isNote -}}
<br>
{{ partial "wordcount.html" . -}}
{{ end }}