diff options
-rw-r--r-- | modules/templates/util_string.go | 4 | ||||
-rw-r--r-- | templates/package/content/container.tmpl | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/modules/templates/util_string.go b/modules/templates/util_string.go index 2ae27d0833..382e2de13f 100644 --- a/modules/templates/util_string.go +++ b/modules/templates/util_string.go @@ -60,3 +60,7 @@ func (su *StringUtils) EllipsisString(s string, maxLength int) string { func (su *StringUtils) ToUpper(s string) string { return strings.ToUpper(s) } + +func (su *StringUtils) TrimPrefix(s, prefix string) string { + return strings.TrimPrefix(s, prefix) +} diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index aaed25bfbd..207774bfef 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -36,11 +36,13 @@ </thead> <tbody> {{range .PackageDescriptor.Metadata.Manifests}} - <tr> - <td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{.Digest}}</a></td> - <td>{{.Platform}}</td> - <td>{{FileSize .Size}}</td> - </tr> + {{if ne .Platform "unknown/unknown"}} + <tr> + <td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}</a></td> + <td>{{.Platform}}</td> + <td>{{FileSize .Size}}</td> + </tr> + {{end}} {{end}} </tbody> </table> |