From 59eae28ed34a1ffa248e01a14534a8487f0afcc5 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 5 Nov 2023 08:56:17 -0300 Subject: [PATCH] NIP-31: display "alt" tag in Other template if available. --- pages.go | 2 +- render_event.go | 2 +- templates/other.html | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pages.go b/pages.go index 24ca88f..aef1084 100644 --- a/pages.go +++ b/pages.go @@ -194,9 +194,9 @@ type OtherPage struct { DetailsPartial `tmpl:"details"` FooterPartial `tmpl:"footer"` - Naddr string Kind int KindDescription string + Alt string } func (*OtherPage) TemplateText() string { return tmplOther } diff --git a/render_event.go b/render_event.go index 0e9ba86..6500bf2 100644 --- a/render_event.go +++ b/render_event.go @@ -362,7 +362,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) { NeventNaked: data.neventNaked, }, DetailsPartial: detailsData, - Naddr: data.naddr, + Alt: data.alt, Kind: data.event.Kind, KindDescription: data.kindDescription, }) diff --git a/templates/other.html b/templates/other.html index 05de226..0384cd0 100644 --- a/templates/other.html +++ b/templates/other.html @@ -2,11 +2,7 @@ - {{ if not (eq "" .Naddr) }} - Nostr Entity {{.Naddr}} - {{ else }} Nostr Event {{.Kind}} - {{.KindDescription }} - {{ end }} {{template "head_common" .HeadCommonPartial}} @@ -28,6 +24,19 @@
{{.KindDescription}}
+ {{ if not (eq "" .Alt) }} +
+ +
+ {{.Alt}} +
+ {{ end }} + + {{template "details" .DetailsPartial}}