mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 18:06:07 +01:00
20 lines
990 B
HTML
20 lines
990 B
HTML
{{- $url := .url -}}
|
|
{{- $references := .references -}}
|
|
{{- $mf2 := .mf2 -}}
|
|
|
|
{{- $hostname := (($url | urls.Parse).Hostname) -}}
|
|
{{- $reference := partial "reference.obj" . -}}
|
|
|
|
{{- if and (not $reference.name) (strings.HasPrefix $url "/") -}}
|
|
{{- $other := site.GetPage $url -}}
|
|
{{- if and $other $other.Page -}}
|
|
{{- $reference = dict "name" (partial "page-title.txt" $other.Page) "type" $other.Page.Type "internal" true -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{ partialCached "svg.html" (dict "name" .svg) .svg }} {{ .phrase }}{{" "}}
|
|
{{- with $reference.name -}}
|
|
{{- if $reference.internal -}}my{{else}}the{{end}} {{ partial "article-type.txt" (default "article" $reference.type) }} {{ partial "rich-link.html" (dict "Class" (printf "%s h-cite" $mf2) "url" $url "Text" . "references" $references) }}.
|
|
{{- else -}}
|
|
{{- $text := printf "an article from %s" $hostname -}}
|
|
{{- partial "rich-link.html" (dict "Class" $mf2 "url" $url "Text" $text "references" $references) }}
|
|
{{- end }}
|