From f499ccde8a7a1590491a4fb40ea3c13deeee4530 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 10:10:17 -0300 Subject: [PATCH] use .display_name on "fulano on Nostr:" headings when .name is not available. --- go.mod | 2 +- go.sum | 4 ++-- templates/file_metadata.html | 2 +- templates/live_event_message.html | 2 +- templates/note.html | 2 +- templates/telegram_instant_view.html | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 199356e..72d8a2d 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/rs/cors v1.10.0 github.com/rs/zerolog v1.29.1 github.com/stretchr/testify v1.8.4 - github.com/tylermmorton/tmpl v0.0.0-20230817025807-fd8b24ce5c3d + github.com/tylermmorton/tmpl v0.0.0-20231025031313-5552ee818c6d golang.org/x/exp v0.0.0-20231006140011-7918f672742d mvdan.cc/xurls/v2 v2.5.0 ) diff --git a/go.sum b/go.sum index 9f859bd..934a38b 100644 --- a/go.sum +++ b/go.sum @@ -196,8 +196,8 @@ github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tylermmorton/tmpl v0.0.0-20230817025807-fd8b24ce5c3d h1:WCBWmVpkAG1Ku1p87irpropCH3ioljo2IuFkTJ+cXJE= -github.com/tylermmorton/tmpl v0.0.0-20230817025807-fd8b24ce5c3d/go.mod h1:aFT85F39qRY7ZZT5pHU01s1Ru3o9EOmbd+UjbrxxHw4= +github.com/tylermmorton/tmpl v0.0.0-20231025031313-5552ee818c6d h1:DZ25KkbqQMYQE9Dk5x4WMJlBg39HSOn0HIn0t6cCSjI= +github.com/tylermmorton/tmpl v0.0.0-20231025031313-5552ee818c6d/go.mod h1:aFT85F39qRY7ZZT5pHU01s1Ru3o9EOmbd+UjbrxxHw4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.47.0 h1:y7moDoxYzMooFpT5aHgNgVOQDrS3qlkfiP9mDtGGK9c= diff --git a/templates/file_metadata.html b/templates/file_metadata.html index 5e79500..57309cc 100644 --- a/templates/file_metadata.html +++ b/templates/file_metadata.html @@ -61,7 +61,7 @@

{{.Subject}}

{{ else }}

- {{.Metadata.Name}} on Nostr: {{.TitleizedContent}} + {{.Metadata.ShortName}} on Nostr: {{.TitleizedContent}}

{{ end }} diff --git a/templates/live_event_message.html b/templates/live_event_message.html index 2cc56f7..b2376cb 100644 --- a/templates/live_event_message.html +++ b/templates/live_event_message.html @@ -62,7 +62,7 @@

{{.Subject}}

{{ else }}

- {{.Metadata.Name}} on Nostr: {{.TitleizedContent}} + {{.Metadata.ShortName}} on Nostr: {{.TitleizedContent}}

{{ end }} diff --git a/templates/note.html b/templates/note.html index 59f1aa1..3b8fd93 100644 --- a/templates/note.html +++ b/templates/note.html @@ -62,7 +62,7 @@

{{.Subject}}

{{ else }}

- {{.Metadata.Name}} on Nostr: {{.TitleizedContent}} + {{.Metadata.ShortName}} on Nostr: {{.TitleizedContent}}

{{ end }} diff --git a/templates/telegram_instant_view.html b/templates/telegram_instant_view.html index dd73e7b..a887fc8 100644 --- a/templates/telegram_instant_view.html +++ b/templates/telegram_instant_view.html @@ -22,14 +22,14 @@ {{ end }} - +

- {{ if not (eq "" .Subject) }} {{.Subject}} {{ else }} {{.Metadata.Name}} on - Nostr: {{ end }} + {{ if not (eq "" .Subject) }} {{.Subject}} {{ else }} + {{.Metadata.ShortName}} on Nostr: {{ end }}

{{ if not (eq "" .Summary) }}