Skip to content

Commit 471a554

Browse files
authored
Merge branch 'main' into fix-actions-status
2 parents cbdc527 + 276f433 commit 471a554

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

modules/templates/util_string.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,7 @@ func (su *StringUtils) EllipsisString(s string, maxLength int) string {
6060
func (su *StringUtils) ToUpper(s string) string {
6161
return strings.ToUpper(s)
6262
}
63+
64+
func (su *StringUtils) TrimPrefix(s, prefix string) string {
65+
return strings.TrimPrefix(s, prefix)
66+
}

templates/package/content/container.tmpl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
</thead>
3737
<tbody>
3838
{{range .PackageDescriptor.Metadata.Manifests}}
39-
<tr>
40-
<td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{.Digest}}</a></td>
41-
<td>{{.Platform}}</td>
42-
<td>{{FileSize .Size}}</td>
43-
</tr>
39+
{{if ne .Platform "unknown/unknown"}}
40+
<tr>
41+
<td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}</a></td>
42+
<td>{{.Platform}}</td>
43+
<td>{{FileSize .Size}}</td>
44+
</tr>
45+
{{end}}
4446
{{end}}
4547
</tbody>
4648
</table>

0 commit comments

Comments
 (0)