+6
appview/pages/funcmap.go
+6
appview/pages/funcmap.go
···
15
15
"split": func(s string) []string {
16
16
return strings.Split(s, "\n")
17
17
},
18
+
"truncateAt30": func(s string) string {
19
+
if len(s) <= 30 {
20
+
return s
21
+
}
22
+
return s[:30] + "…"
23
+
},
18
24
"splitOn": func(s, sep string) []string {
19
25
return strings.Split(s, sep)
20
26
},
+5
-5
appview/pages/templates/timeline.html
+5
-5
appview/pages/templates/timeline.html
···
43
43
{{ $userHandle := index $.DidHandleMap .Repo.Did }}
44
44
<div class="flex items-center">
45
45
<p class="text-gray-600">
46
-
<a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a>
46
+
<a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle | truncateAt30 }}</a>
47
47
created
48
48
<a href="/{{ $userHandle }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ .Repo.Name }}</a>
49
49
<time class="text-gray-700 text-xs">{{ .Repo.Created | timeFmt }}</time>
···
54
54
{{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }}
55
55
<div class="flex items-center">
56
56
<p class="text-gray-600">
57
-
<a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a>
57
+
<a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle | truncateAt30 }}</a>
58
58
followed
59
-
<a href="/{{ $subjectHandle }}" class="no-underline hover:underline">{{ $subjectHandle }}</a>
59
+
<a href="/{{ $subjectHandle }}" class="no-underline hover:underline">{{ $subjectHandle | truncateAt30 }}</a>
60
60
<time class="text-gray-700 text-xs">{{ .Follow.FollowedAt | timeFmt }}</time>
61
61
</p>
62
62
</div>
···
65
65
{{ $repoOwnerHandle := index $.DidHandleMap .Star.Repo.Did }}
66
66
<div class="flex items-center">
67
67
<p class="text-gray-600">
68
-
<a href="/{{ $starrerHandle }}" class="no-underline hover:underline">{{ $starrerHandle }}</a>
68
+
<a href="/{{ $starrerHandle }}" class="no-underline hover:underline">{{ $starrerHandle | truncateAt30 }}</a>
69
69
starred
70
-
<a href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}" class="no-underline hover:underline">{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}</a>
70
+
<a href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}" class="no-underline hover:underline">{{ $repoOwnerHandle | truncateAt30 }}/{{ .Star.Repo.Name }}</a>
71
71
<time class="text-gray-700 text-xs">{{ .Star.Created | timeFmt }}</time>
72
72
</p>
73
73
</div>
+1
-1
appview/pages/templates/user/profile.html
+1
-1
appview/pages/templates/user/profile.html