{{ define "main" }}
{{ $url := "https://api.github.com/repos/DefectDojo/django-DefectDojo/releases/latest" }}
{{ $releaseName := "" }}
{{/* Best-effort: the release chip depends on an unauthenticated GitHub API
call, which is rate-limited (403 Forbidden) on shared CI runners.
Wrap the fetch in `try` so a failed request degrades to "no chip"
instead of failing the whole build (Resource.Err was removed in
Hugo v0.141.0 in favor of the `try` keyword). */}}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ warnf "Release notes fetch failed from %s: %s" $url . }}
{{ else with .Value }}
{{ $release := . | transform.Unmarshal | default dict }}
{{ with $release.name }}
{{ $releaseName = . }}
{{ else }}
{{ warnf "Could not parse release name from %s (not valid JSON or missing field)" $url }}
{{ end }}
{{ else }}
{{ warnf "Release notes fetch returned no resource from %s" $url }}
{{ end }}
{{ end }}
{{ i18n "hero_subtitle" }}
{{ . }} {{ i18n "whats_new" (dict "release" ($releaseName | htmlEscape)) }} →Documentation
{{ i18n "cta_community_text" (dict "link" (printf `%s` (i18n "cta_community_link")) ) | safeHTML }}
{{ i18n "cta_trial_text" (dict "link" (printf `%s` (i18n "cta_trial_link_text")) ) | safeHTML }}
{{ i18n "cta_support_text" }}