NIP-31: display "alt" tag in Other template if available.

This commit is contained in:
fiatjaf
2023-11-05 08:56:17 -03:00
parent 2cacdc84e7
commit 59eae28ed3
3 changed files with 15 additions and 6 deletions

View File

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

View File

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

View File

@@ -2,11 +2,7 @@
<html class="theme--default text-lg font-light print:text-base sm:text-xl">
<meta charset="UTF-8" />
<head>
{{ if not (eq "" .Naddr) }}
<title>Nostr Entity {{.Naddr}}</title>
{{ else }}
<title>Nostr Event {{.Kind}} - {{.KindDescription }}</title>
{{ end }}
<!---->
{{template "head_common" .HeadCommonPartial}}
@@ -28,6 +24,19 @@
<div class="mb-4 text-2xl">{{.KindDescription}}</div>
</header>
{{ if not (eq "" .Alt) }}
<div
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
<article
class="prose-cite:text-sm prose prose mb-6 leading-5 dark:prose-invert"
>
{{.Alt}}
</article>
{{ end }}
<!---->
{{template "details" .DetailsPartial}}
<div