File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,7 @@ func (su *StringUtils) HasPrefix(s, prefix string) bool {
18
18
func (su * StringUtils ) Contains (s , substr string ) bool {
19
19
return strings .Contains (s , substr )
20
20
}
21
+
22
+ func (su * StringUtils ) Split (s , sep string ) []string {
23
+ return strings .Split (s , sep )
24
+ }
Original file line number Diff line number Diff line change 15
15
</div>
16
16
{{end}}
17
17
<div class="item">
18
- <span>{{svg "octicon-database"}} <b>{{FileSize .Repository.Size}}</b></span>
18
+ {{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
19
+ {{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
20
+ <span>{{svg "octicon-database"}} <b>{{index $fileSizeFields 0}}</b> {{index $fileSizeFields 1}}</span>
19
21
</div>
20
22
{{end}}
21
23
</div>
You can’t perform that action at this time.
0 commit comments