{{ define "main" }}
  {{ $docs := (where .Site.RegularPages "Section" "docs").ByWeight }}
  {{ $install := .Site.Params.install }}
  {{ $latestTag := os.Getenv "HUGO_CLNKR_LATEST_TAG" }}
  <div class="retro-home">
    <section class="pane pane-large">
      <div class="pane-bar">
        <span>NAME</span>
        <span>clnkr(1)</span>
      </div>
      <div class="pane-body">
        <p class="line-label">NAME</p>
        <h1>clnkr</h1>
        <p class="one-liner">A minimal, stubborn coding agent with a rough metal finish.</p>

        <p class="line-label">SYNOPSIS</p>
        <ul class="key-value install-list">
          <li>
            <span>{{ $install.homebrew_label }}: <a href="{{ $install.homebrew_url }}">{{ $install.homebrew_command }}</a></span>
          </li>
          <li>
            {{ if $latestTag }}
              {{ $debVersion := replaceRE "^v" "" $latestTag }}
              <span>{{ $install.apt_platform }}: <a href="{{ printf "%s/releases/download/%s/clnkr_%s-1_%s.deb" .Site.Params.repo $latestTag $debVersion $install.apt_arch }}">sudo apt install ./clnkr_{{ $debVersion }}-1_{{ $install.apt_arch }}.deb</a></span>
            {{ else }}
              <span>{{ $install.apt_platform }}: <a href="{{ printf "%s/releases/latest" .Site.Params.repo }}">latest release (.deb)</a></span>
            {{ end }}
          </li>
        </ul>

        <p class="line-label">DESCRIPTION</p>
        <p>clnkr works with a human in the loop, or hand it the wheel with --full-send. Permissions are simple, sharp, and not here to save you from yourself.</p>
      </div>
    </section>

    <aside class="pane pane-sidebar">
      <div class="pane-bar">
        <span class="pane-icon" title="manual index">󰪷</span>
      </div>
      <div class="pane-body">
        <ul class="index-list">
          <li><a href="/evaluations/">evals/</a></li>
          <li><a href="/docs/">docs/</a></li>
          {{ range $docs }}
            <li><a href="{{ .RelPermalink }}">{{ if eq .Title "clnkr" }}man clnkr{{ else if eq .Title "clankerval" }}man clankerval{{ else }}{{ .Title }}{{ end }}</a></li>
          {{ end }}
        </ul>
        <div class="mascot-block">
          <img class="mascot" src="/mascot.png" alt="Pixel-art clnkr mascot">
        </div>
      </div>
    </aside>
  </div>
{{ end }}
