Omphaloskepsis-2/layouts/partials/cite.html

39 lines
1.3 KiB
HTML
Raw Permalink Normal View History

2023-08-07 22:23:46 +00:00
{{- $itemType := default "CreativeWork" ( .Params.schemaType ) -}}
2023-08-22 10:14:33 +00:00
{{- if ( or ( in $.Site.Data.itemtypes $itemType ) ( eq .Params.suppress "true" ) ) -}}
2023-08-07 22:23:46 +00:00
{{- with .Params.href -}}
2023-07-01 03:16:59 +00:00
<a href="{{ if eq . "asCite" }}{{ $.Params.cite }}{{ else }}{{ . }}{{ end }}">
2023-08-07 22:23:46 +00:00
{{- end -}}
<cite
class="cite{{ with .Params.citeStyle }} cite--{{ . }}{{ end }}"
itemscope
itemprop="citation"
itemtype="https://schema.org/{{- $itemType -}}"
{{- if .Params.titleLang -}}
lang="{{- .Params.titleLang -}}"
title="{{- .Params.titleTr -}}"
{{- end -}}>
{{- with .Params.cite -}}
<meta itemprop="url" content="{{ . }}">
{{- end -}}
2023-07-01 03:16:59 +00:00
<span itemprop="name">
{{- if .Params.titleLang -}}
<i lang="{{ .Params.titleLang }}" title="{{ .Params.titleTr }}">
{{- end -}}
{{- if .Params.shortTitle -}}
{{- .Params.shortTitle | markdownify | safeHTML -}}
{{- else -}}
{{- .Params.title | markdownify | safeHTML -}}
{{- end -}}
{{- if .Params.titleLang -}}
</i>
{{- end -}}
</span>{{- /**/ -}}
</cite>
2023-08-07 22:23:46 +00:00
{{- with .Params.href -}}
2023-07-01 03:16:59 +00:00
</a>
2023-08-07 22:23:46 +00:00
{{- end -}}
{{- else -}}
2023-10-03 12:08:35 +00:00
{{- erroridf "invalid-schema-type" "Invalid Schema.org type value %q for %q" $itemType .Params.title -}}
2023-07-01 03:16:59 +00:00
{{- end -}}