-
Notifications
You must be signed in to change notification settings - Fork 24
/
common.templ
66 lines (62 loc) · 2.7 KB
/
common.templ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package main
import "github.com/nbd-wtf/go-nostr/sdk"
var compileTimeTs string
templ headCommonTemplate(params HeadParams) {
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
if params.Oembed != "" {
<link rel="alternate" type="application/json+oembed" href={ params.Oembed + "&format=json" }/>
<link rel="alternate" type="text/xml+oembed" href={ params.Oembed + "&format=xml" }/>
}
if params.IsProfile {
<link rel="apple-touch-icon" sizes="180x180" href="/njump/static/favicon/profile/apple-touch-icon.png?v=2"/>
<link rel="icon" type="image/png" sizes="32x32" href="/njump/static/favicon/profile/favicon-32x32.png?v=2"/>
<link rel="icon" type="image/png" sizes="16x16" href="/njump/static/favicon/profile/favicon-16x16.png?v=2"/>
} else {
<link rel="apple-touch-icon" sizes="180x180" href="/njump/static/favicon/event/apple-touch-icon.png?v=2"/>
<link rel="icon" type="image/png" sizes="32x32" href="/njump/static/favicon/event/favicon-32x32.png?v=2"/>
<link rel="icon" type="image/png" sizes="16x16" href="/njump/static/favicon/event/favicon-16x16.png?v=2"/>
}
<script src="https://unpkg.com/[email protected]"></script>
if tailwindDebugStuff != "" {
@templ.Raw(tailwindDebugStuff)
} else {
<link rel="stylesheet" type="text/css" href={ "/njump/static/tailwind-bundle.min.css?t=" + compileTimeTs }/>
}
<style>
@media print { @page { margin: 2cm 3cm; } }
</style>
<meta name="theme-color" content="#e42a6d"/>
if params.NaddrNaked != "" {
<link rel="canonical" href={ "https://njump.me/" + params.NaddrNaked }/>
} else {
<link rel="canonical" href={ "https://njump.me/" + params.NeventNaked }/>
}
<script type="text/hyperscript">
on load get [navigator.userAgent.includes('Safari'), navigator.userAgent.includes('Chrome')] then if it[0] is true and it[1] is false add .safari to <body /> end
</script>
}
templ authorHeaderTemplate(metadata sdk.ProfileMetadata) {
<header
itemprop="author"
itemscope
itemtype="https://schema.org/Person"
class="mb-4 max-w-full"
>
<a class="flex items-center" itemprop="url" href={ templ.URL("/" + metadata.Npub()) }>
<div class="print:basis-1-12 imgclip mr-2 flex-shrink-0 basis-1/6 overflow-hidden sm:mr-4">
<img itemprop="image" class="block h-auto w-full" src={ metadata.Picture }/>
</div>
<div class="block print:text-base grow">
<div class="leading-4 sm:text-2xl">
<span itemprop="name">{ metadata.Name }</span>
if metadata.Name != metadata.DisplayName {
<span class="text-stone-400 sm:text-xl" itemprop="alternateName">/ { metadata.DisplayName } </span>
}
</div>
<div class="text-sm leading-4 text-stone-400 sm:text-base">
{ metadata.NpubShort() }
</div>
</div>
</a>
</header>
}