furtka/website/layouts/partials/release.html
Daniel Maksymilian Syrnicki 0cad2e05c8 feat(website): download page for the ISO, homepage with download CTA and 3-step how-it-works
- /download/ and /de/download/: big download button, file name, size and
  release date, requirements (64-bit PC, UEFI or BIOS, >=16 GB disk that
  gets erased, USB stick, network cable with internet, second device),
  five install steps (Etcher / Rufus DD mode / dd, boot menu, Secure Boot
  off, proksi.local:5000, wizard, pull stick), checksum + verify commands
  when the release has one, alpha notice, link to all releases
- the release data comes from the Forgejo API at build time
  (partials/release.html): newest release with an .iso asset, falling back
  to params.version if the lookup fails; getresource cache disabled so a
  build never pins an old release
- homepage: status chip follows the latest release, 'Download ISO' primary
  CTA + 'Source code' ghost CTA, numbered how-it-works cards, download band
  before the closer
- releases now upload furtka-<ver>.iso.sha256, and release.yml rebuilds the
  site after publishing so the download page follows each release

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wq1hzUp4ZmCKHDuLKCnu73
2026-09-28 14:52:59 +02:00

57 lines
2.2 KiB
HTML

{{- /*
Latest Furtka release that has an ISO attached, looked up on Forgejo at
build time. Returns a dict: version, url (ISO), size (bytes, 0 = unknown),
date (time or ""), sha256 ("" when the release has no .iso.sha256), page
(release page URL), live (false when the lookup failed and we fell back
to site.Params.version). Use via partialCached "release.html" . "release".
*/ -}}
{{- $repo := printf "%s/%s" site.Params.forgejoURL site.Params.repoPath -}}
{{- $v := site.Params.version -}}
{{- $out := dict
"version" $v
"url" (printf "%s/releases/download/%s/furtka-%s.iso" $repo $v $v)
"size" 0
"date" ""
"sha256" ""
"page" (printf "%s/releases/tag/%s" $repo $v)
"all" (printf "%s/releases" $repo)
"live" false
-}}
{{- $api := printf "%s/api/v1/repos/%s/releases?limit=10" site.Params.forgejoURL site.Params.repoPath -}}
{{- with try (resources.GetRemote $api) -}}
{{- with .Err -}}
{{- warnf "release.html: release lookup failed, using site.Params.version: %s" . -}}
{{- else with .Value -}}
{{- $done := false -}}
{{- range (. | transform.Unmarshal) -}}
{{- if and (not $done) (not .draft) -}}
{{- $rel := . -}}
{{- $iso := "" -}}
{{- $sum := "" -}}
{{- range .assets -}}
{{- if strings.HasSuffix .name ".iso" }}{{ $iso = . }}{{ end -}}
{{- if strings.HasSuffix .name ".iso.sha256" }}{{ $sum = . }}{{ end -}}
{{- end -}}
{{- with $iso -}}
{{- $done = true -}}
{{- $out = merge $out (dict
"version" $rel.tag_name
"url" .browser_download_url
"size" .size
"date" (time.AsTime $rel.published_at)
"page" $rel.html_url
"live" true) -}}
{{- with $sum -}}
{{- with try (resources.GetRemote .browser_download_url) -}}
{{- with .Value -}}
{{- $hash := index (split (trim .Content " \n") " ") 0 -}}
{{- if eq (len $hash) 64 }}{{ $out = merge $out (dict "sha256" $hash) }}{{ end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- return $out -}}