use .display_name on "fulano on Nostr:" headings when .name is not available.

This commit is contained in:
fiatjaf
2023-11-15 10:10:17 -03:00
parent 929307f3ba
commit f499ccde8a
6 changed files with 9 additions and 9 deletions

2
go.mod
View File

@@ -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
)

4
go.sum
View File

@@ -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=

View File

@@ -61,7 +61,7 @@
<h1 class="text-2xl">{{.Subject}}</h1>
{{ else }}
<h1 class="hidden">
{{.Metadata.Name}} on Nostr: {{.TitleizedContent}}
{{.Metadata.ShortName}} on Nostr: {{.TitleizedContent}}
</h1>
{{ end }}
<!-- main content -->

View File

@@ -62,7 +62,7 @@
<h1 class="text-2xl">{{.Subject}}</h1>
{{ else }}
<h1 class="hidden">
{{.Metadata.Name}} on Nostr: {{.TitleizedContent}}
{{.Metadata.ShortName}} on Nostr: {{.TitleizedContent}}
</h1>
{{ end }}
<!-- main content -->

View File

@@ -62,7 +62,7 @@
<h1 class="text-2xl">{{.Subject}}</h1>
{{ else }}
<h1 class="hidden">
{{.Metadata.Name}} on Nostr: {{.TitleizedContent}}
{{.Metadata.ShortName}} on Nostr: {{.TitleizedContent}}
</h1>
{{ end }}
<!-- main content -->

View File

@@ -22,14 +22,14 @@
{{ end }}
<!-- stuff that affects the content inside the preview window -->
<meta name="author" content="{{.Metadata.Name}}" />
<meta name="author" content="{{.Metadata.ShortName}}" />
<meta name="telegram:channel" content="@nostr_protocol" />
<!-- basic content of the preview window -->
<article>
<h1>
{{ if not (eq "" .Subject) }} {{.Subject}} {{ else }} {{.Metadata.Name}} on
Nostr: {{ end }}
{{ if not (eq "" .Subject) }} {{.Subject}} {{ else }}
{{.Metadata.ShortName}} on Nostr: {{ end }}
</h1>
{{ if not (eq "" .Summary) }}