diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 98cfdc6..f9e066c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -24,7 +24,7 @@ {{- .Scratch.Set "shortMeta" true -}} - {{- partial "post-meta/post-meta.html" . }} + {{- partial "post-meta/post-meta.html" (dict "context" . "isList" true) }} {{- if eq .Section "notes" }}
{{- if .Params.replyURI -}} diff --git a/layouts/partials/full-article.html b/layouts/partials/full-article.html index 41aebd3..f26b2a1 100644 --- a/layouts/partials/full-article.html +++ b/layouts/partials/full-article.html @@ -1,7 +1,7 @@

{{ .Title }}

{{- if not .Params.disableMeta -}} - {{- partial "post-meta/post-meta.html" . -}} + {{- partial "post-meta/post-meta.html" (dict "context" . "isList" false) -}} {{- end -}}

diff --git a/layouts/partials/post-meta/post-meta.html b/layouts/partials/post-meta/post-meta.html index d729554..328cdc4 100644 --- a/layouts/partials/post-meta/post-meta.html +++ b/layouts/partials/post-meta/post-meta.html @@ -1,22 +1,22 @@ -{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}} +{{- $canonicalRelPermalink := .context.RelPermalink | replaceRE "^/~seirdy/" "/" -}} {{- $isNotes := false -}} {{- $action := "Posted" -}} {{- $shortMeta := false -}} -{{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path -}} -{{- if .Scratch.Get "shortMeta" -}} +{{- $logURL := printf "%scontent/%s" .context.Site.Params.logUrlPrefix .context.File.Path -}} +{{- if .context.Scratch.Get "shortMeta" -}} {{- $shortMeta = true -}} {{- end -}} -{{- if or (eq .Page.Section "notes") (eq .Page.Title "Notes") -}} +{{- if or (eq .context.Page.Section "notes") (eq .context.Page.Title "Notes") -}} {{- $isNotes = true -}} {{- $action = "Noted" -}} {{- end -}} -{{- $needsModTime := gt (sub .Lastmod.Unix .Date.Unix) 900 -}} +{{- $needsModTime := gt (sub .context.Lastmod.Unix .context.Date.Unix) 900 -}} {{- $needsList := or (and (not $shortMeta) $needsModTime) (not $isNotes) -}} {{- $gemini := "" }} -{{- with .OutputFormats.Get "gemtext" -}} +{{- with .context.OutputFormats.Get "gemtext" -}} {{- $gemini = replace .Permalink "/gemini" "" 1 | safeURL -}} {{- end -}} -{{- if not (eq .Page.Section "posts" ) -}} +{{- if not (eq .context.Page.Section "posts" ) -}} {{- $gemini = replace $gemini "/index.gmi" ".gmi" | safeURL -}} {{- end -}} {{- if $needsList }} @@ -25,16 +25,16 @@

{{- end }} {{ if $needsList }}

  • {{ end }} -{{- $action }} {{ .Date.UTC.Format "2006-01-02" }} by {{ partialCached "indieweb-author.html" . -}}{{ if not $shortMeta }} on his {{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and Gemini capsule{{ end }}{{- end -}}. +{{- $action }} {{ .context.Date.UTC.Format "2006-01-02" }} by {{ partialCached "indieweb-author.html" .context -}}{{ if not .isList }} on his {{- with .context.OutputFormats.Get "gemtext" -}}{{- printf " " -}}and Gemini capsule{{ end }}{{- end -}}. {{ if $needsList }}
  • {{ end }} - {{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}} + {{- if gt (sub .context.Lastmod.Unix .context.Date.Unix) 900 -}} {{ if $needsList }}
  • {{ end }} - Last updated .{{ if not $shortMeta }} Changelog{{ end }} + Last updated .{{ if not .isList }} Changelog{{ end }} {{ if $needsList }}
  • {{ end }} {{- end -}} {{- if not $isNotes -}} {{ if $needsList }}
  • {{ else }}
    {{ end }} - {{ partial "post-meta/wordcount.html" . -}} + {{ partial "post-meta/wordcount.html" .context -}} {{ if $needsList }}
  • {{ end }} {{- end -}} {{- if $needsList }}