1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00
seirdy.one/layouts/shortcodes/mention-work.html
Rohan Kumar c3ae952081
Improvements to citations
- Put reply-context in a paragraph
- Allow an itemid for mention-work
2022-08-01 20:55:33 -07:00

15 lines
741 B
HTML

{{- $itemprop := "mentions" -}}
{{- with .Get "itemprop" -}}
{{ $itemprop = . }}
{{- end -}}
{{- if .Get "p" -}}
<p
class="h-cite{{ with .Get "reply" }} in-reply-to{{ end }}"{{ with .Get "itemid" }} itemid="{{ . }}"{{ end }} itemprop="{{ $itemprop }}"{{ with .Get "role" }} role="{{ . }}"{{ end }} itemscope="" itemtype="https://schema.org/{{ .Get "itemtype" }}">
{{- .Inner | markdownify | safeHTML -}}
</p>
{{- else -}}
<span
class="h-cite{{ with .Get "reply" }} in-reply-to{{ end }}"{{ with .Get "itemid" }} itemid="{{ . }}"{{ end }} itemprop="{{ $itemprop }}"{{ with .Get "role" }} role="{{ . }}"{{ end }} itemscope="" itemtype="https://schema.org/{{ .Get "itemtype" }}">
{{- .Inner | markdownify | safeHTML -}}
</span>
{{- end -}}