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

Webmentions: trim displayed URLs

When a title is unavailable, we fall back to displaying the URL. Trim
the https://(www.)? prefix and trailing slashes.
This commit is contained in:
Rohan Kumar 2022-05-01 21:47:09 -07:00
parent 88689a9676
commit 8bcfa63859
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -28,7 +28,7 @@
{{- if $webmention.title -}}
{{- $webmention.title | truncate 200 -}}
{{- else -}}
{{- $webmention.source | truncate 35 -}}
{{- $webmention.source | strings.TrimPrefix "https://" | strings.TrimPrefix "www." | strings.TrimRight "/" | truncate 35 -}}
{{- end -}}
</span></a>
{{- if $webmention.author_name }}