mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 09:46:11 +01:00
22 lines
604 B
HTML
22 lines
604 B
HTML
{{ $typeStr := .Type | singularize }}
|
|
|
|
{{- $url := "" -}}
|
|
{{- if .Params.bookmarkOf -}}
|
|
{{- $url = .Params.bookmarkOf -}}
|
|
{{- else if .Params.inReplyTo -}}
|
|
{{- $url = .Params.inReplyTo -}}
|
|
{{- end -}}
|
|
|
|
{{- $reference := dict -}}
|
|
{{- range .Params.references -}}
|
|
{{- if eq .url $url -}}
|
|
{{- $reference = . -}}
|
|
{{- end }}
|
|
{{- end -}}
|
|
|
|
{{- if $reference.type -}}
|
|
{{- $targetType := partial "partials/article-type.html" (default "article" $reference.type) -}}
|
|
{{- (printf "%s %s" $targetType $typeStr) | strings.FirstUpper -}}
|
|
{{- else -}}
|
|
{{- $typeStr | strings.FirstUpper -}}
|
|
{{- end -}}
|