{{ define "digest" }} {{ template "head" . }} {{ template "meta" .Meta }} {{ template "nav" . }}
{{/* Helm chart with parsed metadata: lead with chart name + version so the page reads as a chart, not a digest. */}} {{ $helmMeta := "" }} {{ if and .HelmContent .HelmContent.Meta }}{{ $helmMeta = .HelmContent.Meta }}{{ end }}
{{ if $helmMeta }}

{{ icon "helm" "size-5 text-base-content/70 shrink-0" }} {{ $helmMeta.Name }} {{ if $helmMeta.Version }}{{ $helmMeta.Version }}{{ end }}

Helm chart {{ else if .Manifest.Tags }}

{{ range $i, $tag := .Manifest.Tags }}{{ if lt $i 3 }}{{ if $i }}{{ end }}{{ $tag }}{{ end }}{{ end }}{{ if gt (len .Manifest.Tags) 3 }}+{{ sub (len .Manifest.Tags) 3 }} more{{ end }}

{{ else }}

{{ truncateDigest (trimPrefix "sha256:" .Manifest.Digest) 16 }}

{{ end }} {{ if .Manifest.IsManifestList }} Multi-arch {{ else if and (eq .Manifest.ArtifactType "helm-chart") (not $helmMeta) }} {{ icon "helm" "size-3" }} Helm {{ end }} {{ if .Manifest.HasAttestations }} {{ icon "shield-check" "size-3" }} Attested {{ end }}
{{ if $helmMeta }} {{/* Subtitle: appVersion + chart type */}}
{{ if $helmMeta.AppVersion }}appVersion {{ $helmMeta.AppVersion }}{{ if $helmMeta.Type }} ยท {{ end }}{{ end }}{{ if $helmMeta.Type }}{{ $helmMeta.Type }} chart{{ end }} {{ if $helmMeta.Deprecated }}Deprecated{{ end }}
{{ if .Manifest.Tags }}
{{ range .Manifest.Tags }}{{ . }}{{ end }}
{{ end }} {{ end }}
{{ truncateDigest (trimPrefix "sha256:" .Manifest.Digest) 16 }}
{{ if not .Manifest.CreatedAt.IsZero }} {{ icon "history" "size-4" }}{{ timeAgoShort .Manifest.CreatedAt }} {{ end }}
{{ if .Manifest.IsManifestList }}
{{ end }}
{{ if .Manifest.IsManifestList }} {{ if .Manifest.Platforms }}
{{ icon "loader" "size-6 animate-spin text-base-content/40" }} Loading layers and vulnerabilities...
{{ else }}

No platform manifests found for this image index.

{{ end }} {{ else if eq .Manifest.ArtifactType "helm-chart" }} {{ template "helm-digest-content" (dict "Manifest" .Manifest "HelmContent" .HelmContent "RegistryURL" .RegistryURL "OwnerHandle" .Owner.Handle "RepoName" .Repository "OciClient" .OciClient "IsLoggedIn" (ne .User nil)) }} {{ else }} {{ template "digest-content" . }} {{ end }}
{{ template "footer" . }} {{ end }}