{{ template "header" .}}

<main>
  {{ if .gist }} {{ range $key, $value := .gist}}
  <div class="button-parent">
    <a href="/download/gist/{{.Refname}}/{{$value.Revision}}" class="button"
      >Download (zip)</a
    >
    <a href="https://gist.github.com/{{.Refname}}" class="button"
      >View on GitHub</a
    >
  </div>
  <div class="user-profile">
    <h1>{{.Fullname}}</h1>
    {{ if .Parent }}
    <p>This repository is a fork of <a href="/{{.Parent}}">{{.Parent}}</a>.</p>
    {{ end }} {{ if .Description }}
    <p>{{.Description}}</p>
    {{ end }}
    <p>⭐ {{.Stars}} 🍴 {{.Forks}}</p>
  </div>
  {{end}} {{ if .files}}
  <div class="user-readme">
    {{ range $key, $value := .files}}
    <p><a id="{{.Name}}" href="#{{.Name}}">{{.Name}}</a></p>
    <style>
      // prettier-ignore
      {{.Css}}
      pre {
        white-space: pre-wrap;
        word-wrap: break-word;
      }
    </style>
    {{.File}} {{ end }}
  </div>
  {{ end }} {{ if .readme}}
  <div class="user-readme">
    {{ if .repo }} {{ range $key, $value := .repo}}
    <h3>{{.Readme}}</h3>
    {{end}} {{end}}
    <div class="user-readme-text">{{ unescape .readme}}</div>
  </div>
  {{ end }} {{ else }}
  <h2>Repository not found</h2>
  <p>That repository doesn't exist.</p>
  {{ end }}
</main>
{{ template "footer" .}}
