1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-27 14:12: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 -}} {{- if $webmention.title -}}
{{- $webmention.title | truncate 200 -}} {{- $webmention.title | truncate 200 -}}
{{- else -}} {{- else -}}
{{- $webmention.source | truncate 35 -}} {{- $webmention.source | strings.TrimPrefix "https://" | strings.TrimPrefix "www." | strings.TrimRight "/" | truncate 35 -}}
{{- end -}} {{- end -}}
</span></a> </span></a>
{{- if $webmention.author_name }} {{- if $webmention.author_name }}