{{ template "header" .}}

<main>
  {{ if .dir }} {{ range $key, $value := .dir}}
  <div class="button-parent">
    <a rel="noreferrer" href="https://github.com/{{.Username}}/{{.Reponame}}/tree/{{.Branch}}/{{.DirName}}" class="button">GitHubで確認</a>
    <a href="/{{.Username}}/{{.Reponame}}/tree/{{.Branch}}/{{.Branch}}" class="button">{{.Username}}/{{.Reponame}}へ戻る</a>
  </div>

  <div class="user-profile">
    <h1><a href="/{{.Username}}">{{.Username}}</a>/<a href="/{{.Username}}/{{.Reponame}}">{{.Reponame}}</a> | {{.DirName}}</h1>
  </div>
  {{end}} {{ if .files}}
  <div class="user-readme">
    <h3>ファイル</h3>
    <table class="user-readme-text file-table">
      <tbody>
        {{ range $key, $value := .files}}
        <tr class="file-u-list">
          {{ if eq .Type "dir" }}
          <td class="file-list">📁 <a href="/{{.Username}}/{{.Reponame}}/tree/{{.Branch}}/{{.DirName}}/{{.Path}}" class="filesA">{{.Path}}</a></td>
          {{ else }}
          <td class="file-list">🗒️ <a href="/{{.Username}}/{{.Reponame}}/blob/{{.Branch}}/{{.DirName}}/{{.Path}}">{{.Path}}</a></td>
          {{ end }}
          <td class="file-list">{{.Commit}}</td>
          <td class="file-list" style="text-align: right;">{{.Date}}</td>
        </tr>
        {{ end }}
      </tbody>
    </table>
  </div>
  {{ end }} {{ if .readme}}
  <div class="user-readme">
    {{ if .dir }} {{ range $key, $value := .dir }}
    <h3>{{.Readme}}</h3>
    {{end}} {{end}}
    <div class="user-readme-text">{{ unescape .readme}}</div>
  </div>
  {{ end }} {{ else }}
  <h2>フォルダを見つけられません</h2>
  <p>このフォルダが存在しないようです。</p>
  {{ end }}
</main>
{{ template "footer" .}}
