forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "title" }} commit {{ .Diff.Commit.This }} · {{ .RepoInfo.FullName }} {{ end }}
2
3{{ define "extrameta" }}
4 {{ $title := printf "commit %s · %s" .Diff.Commit.This .RepoInfo.FullName }}
5 {{ $url := printf "https://tangled.sh/%s/commit/%s" .RepoInfo.FullName .Diff.Commit.This }}
6
7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
8{{ end }}
9
10
11{{ define "repoContent" }}
12
13{{ $repo := .RepoInfo.FullName }}
14{{ $commit := .Diff.Commit }}
15
16<section class="commit dark:text-white">
17 <div id="commit-message">
18 {{ $messageParts := splitN $commit.Message "\n\n" 2 }}
19 <div>
20 <p class="pb-2">{{ index $messageParts 0 }}</p>
21 {{ if gt (len $messageParts) 1 }}
22 <p class="mt-1 cursor-text pb-2 text-sm">{{ nl2br (index $messageParts 1) }}</p>
23 {{ end }}
24 </div>
25 </div>
26
27 <div class="flex items-center space-x-2">
28 <p class="text-sm text-gray-500 dark:text-gray-300">
29 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
30
31 {{ if $didOrHandle }}
32 <a href="/{{ $didOrHandle }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $didOrHandle }}</a>
33 {{ else }}
34 <a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $commit.Author.Name }}</a>
35 {{ end }}
36 <span class="px-1 select-none before:content-['\00B7']"></span>
37 {{ timeFmt $commit.Author.When }}
38 <span class="px-1 select-none before:content-['\00B7']"></span>
39 </p>
40
41 <p class="flex items-center text-sm text-gray-500 dark:text-gray-300">
42 <a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.This 0 8 }}</a>
43 {{ if $commit.Parent }}
44 {{ i "arrow-left" "w-3 h-3 mx-1" }}
45 <a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.Parent 0 8 }}</a>
46 {{ end }}
47 </p>
48
49 {{ if .Verified }}
50 <span class="text-sm bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 py-1 rounded">
51 <div class="flex items-center gap-2">
52 {{ i "shield-check" "w-4 h-4" }}
53 verified
54 </div>
55 </span>
56 {{ end }}
57 </div>
58
59</section>
60
61{{end}}
62
63{{ define "repoAfter" }}
64{{ template "repo/fragments/diff" (list .RepoInfo.FullName .Diff) }}
65{{end}}