This repository has no description
1{{ define "title" }}{{ resolve .Card.UserDid }} · Tangled{{ end }}
2
3{{ define "extrameta" }}
4 {{ $handle := resolve .Card.UserDid }}
5 {{ $avatarUrl := profileAvatarUrl .Card.Profile "" }}
6 {{ $description := or .Card.Profile.Description (printf "%s on Tangled" $handle) }}
7 {{ $url := printf "https://tangled.org/%s" $handle }}
8
9 <!-- Open Graph Meta Tags -->
10 <meta property="og:title" content="{{ $handle }}" />
11 <meta property="og:type" content="profile" />
12 <meta property="og:url" content="{{ $url }}" />
13 <meta property="og:description" content="{{ $description }}" />
14 <meta property="og:image" content="{{ $avatarUrl }}" />
15 <meta property="og:image:width" content="512" />
16 <meta property="og:image:height" content="512" />
17 <meta property="og:image:alt" content="{{ $handle }}'s avatar" />
18 <meta property="profile:username" content="{{ $handle }}" />
19
20 <!-- Twitter Card Meta Tags -->
21 <meta name="twitter:card" content="summary" />
22 <meta name="twitter:title" content="{{ $handle }}" />
23 <meta name="twitter:description" content="{{ $description }}" />
24 <meta name="twitter:image" content="{{ $avatarUrl }}" />
25 <meta name="twitter:image:alt" content="{{ $handle }}'s avatar" />
26
27 <!-- Additional SEO -->
28 <meta name="description" content="{{ $description }}" />
29 <link rel="canonical" href="{{ $url }}" />
30{{ end }}
31
32{{ define "content" }}
33 {{ if not .Card.IsTangledUser }}
34 <section class="bg-white dark:bg-gray-800 px-2 py-6 md:p-6 rounded w-full dark:text-white shadow-sm">
35 <div class="flex items-center gap-6 p-4">
36 <img class="w-28 h-28 shrink-0 object-cover rounded-full" src="{{ profileAvatarUrl .Card.Profile "" }}" />
37 <div>
38 <p class="text-lg font-bold">{{ resolve .Card.UserDid }}</p>
39 <p class="text-gray-700 dark:text-gray-300 mt-2">This user hasn't joined Tangled yet.</p>
40 <p class="text-sm text-gray-500 dark:text-gray-400 mt-1">Let them know we're waiting for them!</p>
41 </div>
42 </div>
43 </section>
44 {{ else }}
45 {{ template "profileTabs" . }}
46 <section class="bg-white dark:bg-gray-800 px-2 py-6 md:p-6 rounded w-full dark:text-white shadow-sm">
47 <div class="grid grid-cols-1 md:grid-cols-11 gap-4">
48 {{ $style := "hidden md:block md:col-span-3" }}
49 {{ if eq $.Active "overview" }}
50 {{ $style = "md:col-span-3" }}
51 {{ end }}
52 <div class="{{ $style }} order-1 order-1">
53 <div class="flex flex-col gap-4">
54 {{ template "user/fragments/profileCard" .Card }}
55 {{ if .Card.Punchcard }}
56 {{ block "punchcard" .Card.Punchcard }} {{ end }}
57 {{ with .Card.ProfileScript }}
58 <script defer type="module" src="{{ . }}?v=2"></script>
59 {{ end }}
60 {{ end }}
61 </div>
62 </div>
63
64 {{ block "profileContent" . }} {{ end }}
65 </div>
66 </section>
67 {{ end }}
68{{ end }}
69
70{{ define "profileTabs" }}
71<nav class="w-full pl-4 overflow-x-auto overflow-y-hidden">
72 <div class="flex z-60">
73 {{ $activeTabStyles := "-mb-px bg-white dark:bg-gray-800" }}
74 {{ $tabs := .Card.GetTabs }}
75 {{ $tabmeta := dict "x" "y" }}
76 {{ range $item := $tabs }}
77 {{ $key := index $item 0 }}
78 {{ $value := index $item 1 }}
79 {{ $icon := index $item 2 }}
80 {{ $meta := index $item 3 }}
81 <a
82 href="?tab={{ $value }}"
83 class="relative -mr-px group no-underline hover:no-underline"
84 hx-boost="true">
85 <div
86 class="px-4 py-1 mr-1 text-black dark:text-white min-w-[80px] text-center relative rounded-t whitespace-nowrap
87 {{ if eq $.Active $key }}
88 {{ $activeTabStyles }}
89 {{ else }}
90 group-hover:bg-gray-100/25 group-hover:dark:bg-gray-700/25
91 {{ end }}
92 ">
93 <span class="flex items-center justify-center">
94 {{ i $icon "w-4 h-4 mr-2" }}
95 {{ if eq $key "repos" }}Repositories{{ else }}{{ $key | capitalize }}{{ end }}
96 {{ if $meta }}
97 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm ml-1">{{ scaleFmt $meta }}</span>
98 {{ end }}
99 </span>
100 </div>
101 </a>
102 {{ end }}
103 </div>
104</nav>
105{{ end }}
106
107{{ define "punchcard" }}
108 {{ $now := now }}
109 <div>
110 <p class="px-2 pb-4 flex gap-2 items-baseline text-base font-medium dark:text-white">
111 Punchcard
112 <span class="font-mono font-normal text-sm text-gray-500 dark:text-gray-400 ">
113 {{ .Total | int64 | commaFmt }} commits
114 </span>
115 </p>
116 <div data-punchcard class="grid grid-cols-28 md:grid-cols-14 gap-y-3 w-full h-full">
117 {{ range .Punches }}
118 {{ $count := .Count }}
119 {{ $theme := "bg-gray-200 dark:bg-gray-700 size-[4px]" }}
120 {{ if lt $count 1 }}
121 {{ $theme = "bg-gray-200 dark:bg-gray-700 size-[4px]" }}
122 {{ else if lt $count 2 }}
123 {{ $theme = "bg-green-200 dark:bg-green-900 size-[5px]" }}
124 {{ else if lt $count 4 }}
125 {{ $theme = "bg-green-300 dark:bg-green-800 size-[5px]" }}
126 {{ else if lt $count 8 }}
127 {{ $theme = "bg-green-400 dark:bg-green-700 size-[6px]" }}
128 {{ else }}
129 {{ $theme = "bg-green-500 dark:bg-green-600 size-[7px]" }}
130 {{ end }}
131
132 {{ if .Date.After $now }}
133 {{ $theme = "border border-gray-200 dark:border-gray-700 size-[4px]" }}
134 {{ end }}
135 <div class="w-full h-full flex justify-center items-center">
136 <div
137 class="aspect-square rounded-full transition-all duration-300 {{ $theme }} max-w-full max-h-full"
138 title="{{ .Date.Format "2006-01-02" }}: {{ .Count }} commits">
139 </div>
140 </div>
141 {{ end }}
142 </div>
143 </div>
144{{ end }}
145
146{{ define "layouts/profilebase" }}
147 {{ template "layouts/base" . }}
148{{ end }}