1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Improvements to citations

- Put reply-context in a paragraph
- Allow an itemid for mention-work
This commit is contained in:
Rohan Kumar 2022-08-01 20:55:33 -07:00
parent 30e59289ce
commit c3ae952081
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 4 additions and 2 deletions

View file

@ -11,6 +11,7 @@
{{- $replyAuthorRel = "publisher" -}} {{- $replyAuthorRel = "publisher" -}}
{{- end -}} {{- end -}}
<aside role="note"> <aside role="note">
<p>
Reply to <span class="h-cite in-reply-to" itemprop="about" itemscope="" itemtype="https://schema.org/{{ $schemaType }}"> Reply to <span class="h-cite in-reply-to" itemprop="about" itemscope="" itemtype="https://schema.org/{{ $schemaType }}">
<cite itemprop="name" class="p-name"> <cite itemprop="name" class="p-name">
<a class="u-url" itemprop="url" href="{{ .replyURI }}">{{ .replyTitle | safeHTML}}</a> <a class="u-url" itemprop="url" href="{{ .replyURI }}">{{ .replyTitle | safeHTML}}</a>
@ -20,4 +21,5 @@
<span itemprop="name" class="p-name fn n">{{ .replyAuthor }}</span></a> <span itemprop="name" class="p-name fn n">{{ .replyAuthor }}</span></a>
</span> </span>
</span> </span>
</p>
</aside> </aside>

View file

@ -4,12 +4,12 @@
{{- end -}} {{- end -}}
{{- if .Get "p" -}} {{- if .Get "p" -}}
<p <p
class="h-cite{{ with .Get "reply" }} in-reply-to{{ end }}" itemprop="{{ $itemprop }}"{{ with .Get "role" }} role="{{ . }}"{{ end }} itemscope="" itemtype="https://schema.org/{{ .Get "itemtype" }}"> 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 -}} {{- .Inner | markdownify | safeHTML -}}
</p> </p>
{{- else -}} {{- else -}}
<span <span
class="h-cite{{ with .Get "reply" }} in-reply-to{{ end }}" itemprop="{{ $itemprop }}"{{ with .Get "role" }} role="{{ . }}"{{ end }} itemscope="" itemtype="https://schema.org/{{ .Get "itemtype" }}"> 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 -}} {{- .Inner | markdownify | safeHTML -}}
</span> </span>
{{- end -}} {{- end -}}