www.byjp.me/layouts/partials/page-title.txt
JP Hastings-Spital e132790db4
Some checks failed
/ build (push) Failing after 1m16s
Fix likes
2025-05-22 17:42:26 +01:00

26 lines
No EOL
984 B
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{- define "partials/fallback-title.txt" -}}
{{- .Type | singularize | title }} from {{ partial "year-relative-date.txt" .Date -}}
{{- end -}}
{{- if .Title -}}
{{- .Title -}}
{{- else if or .Params.bookmarkOf .Params.repostOf -}}
{{- $ref := partial "reference.obj" (dict "url" (.Params.bookmarkOf | default .Params.repostOf) "references" .Params.references) -}}
{{- if $ref -}}
Comments on '{{ $ref.name }}'
{{- else -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}
{{- else if .Params.likeOf -}}
{{- $ref := partial "reference.obj" (dict "url" .Params.likeOf "references" .Params.references) -}}
{{- if $ref -}}
{{- with index (split $ref.name "|" | first 1) 0 -}}
{{- trim . "  " -}}
{{- else -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}
{{- else -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}
{{- else -}}
{{- template "partials/fallback-title.txt" . -}}
{{- end -}}