<%
  const capFirst = s => (s && s[0].toUpperCase() + s.slice(1)) || "";
%>

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><%= capFirst(repo_name) %> Rustdocs</title>
    <meta name="description" content="Nothing here." />
    <meta name="robots" content="noindex">
    <style>
      body {
        font-family: Helvetica, Arial, Sans Serif;
        margin: 0;
      }
      .center-me {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
      }
      .content {
        display: block;
      }
      .content li {
        font-size: 1em;
        line-height: .4em;
        padding: .8em 0;
      }
    </style>
  </head>

  <body>
    <div class="center-me">
      <div class="content">
        <h1><%= capFirst(repo_name) %> Rustdocs</h1>
        <section>
          <ul>
          <%_ deploy_refs.split(/\s+/).forEach(ref => { _%>
            <li>
              <a href="/<%= repo_name _%>/<%= ref _%>"><%- ref -%></a>
              <%_ if (latest && latest.trim() !== '' && latest === ref) { _%>
                (<a href="/<%= repo_name _%>/latest">latest</a>)
              <%_ } _%>
            </li>
          <%_ }) _%>
          </ul>
        </section>
      </div>
    </div>
  </body>
</html>
