mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-31 19:54:29 +01:00
NIP-31: display "alt" tag in Other template if available.
This commit is contained in:
2
pages.go
2
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 }
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user