mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-10 00:12:09 +00:00
Fix authorship metadata
This commit is contained in:
parent
cd82ce39ec
commit
a4f5f797b6
2 changed files with 12 additions and 3 deletions
|
@ -2,12 +2,20 @@
|
|||
{{- with .replyType -}}
|
||||
{{- $schemaType = . -}}
|
||||
{{- end -}}
|
||||
{{- $replyAuthorType := "Person" -}}
|
||||
{{- with .replyAuthorType -}}
|
||||
{{- $replyAuthorType = . -}}
|
||||
{{- end -}}
|
||||
{{- $replyAuthorRel := "author" -}}
|
||||
{{- if eq $replyAuthorType "Organization" -}}
|
||||
{{- $replyAuthorRel = "publisher" -}}
|
||||
{{- end -}}
|
||||
<aside role="note">
|
||||
Reply to <span class="h-cite in-reply-to" itemprop="about" itemscope="" itemtype="https://schema.org/{{ $schemaType }}">
|
||||
<cite itemprop="name" class="p-name">
|
||||
<a class="u-url" itemprop="url" href="{{ .replyURI }}">{{ .replyTitle | safeHTML}}</a>
|
||||
</cite> by
|
||||
<span itemprop="author" itemscope="" itemtype="https://schema.org/Person" class="h-card vcard p-author">
|
||||
<span itemprop="{{ $replyAuthorRel }}" itemscope="" itemtype="https://schema.org/{{ $replyAuthorType }}" class="h-card vcard p-author">
|
||||
<a itemprop="url" href="{{ .replyAuthorURI }}" class="u-url url">
|
||||
<span itemprop="name" class="p-name fn n">{{ .replyAuthor }}</span></a>
|
||||
</span>
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
{{- $hasContent := and (isset $webmention "content") (gt (countrunes $webmention.content) 50) -}}
|
||||
{{- $title := $webmention.title -}}
|
||||
{{- /* Remove extraneous crap from Fediverse webmentions */ -}}
|
||||
{{- if findRE "@Seirdy@pleroma.envs.net" $webmention.title -}}
|
||||
{{- $title = $title | replaceRE `@Seirdy@pleroma.envs.net(\n| )?` "" -}}
|
||||
{{- if findRE "@Seirdy" $webmention.title -}}
|
||||
{{- $title = $title | replaceRE `^@Seirdy@pleroma.envs.net(\n| )?` "" -}}
|
||||
{{- /* Mastodon webmentions may include the author in the title followed by a colon; this is redundant. */ -}}
|
||||
{{- if and (isset $webmention "author_name") (findRE `@` $webmention.source) (not (findRE "^https://bridg.gy" $webmention.source)) -}}
|
||||
{{ $title = $title | replaceRE `^[^:]{0,20}: ?` "" }}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Reference in a new issue