mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-08 21:25:56 +01:00
26 lines
No EOL
984 B
Text
26 lines
No EOL
984 B
Text
{{- 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 -}} |