htmlroc/template.html

64 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Little Pony CCG Comprehensive Rules</title>
<link rel="stylesheet" href="static/style.min.css">
<script src="static/script.min.js" defer></script>
</head>
<body>
<nav class="topbar"></nav>
<main>
<header class="credits">
{{ .Credits | toCredits }}
</header>
<section class="toc">
<h2>Table of contents</h2>
<ul>
{{ range .Sections }}
<li>
<a href="#{{ .ID }}">{{ .ID }}. {{ .Title }}</a>
<ul>
{{ range .Rules }}
{{ if (eq .Depth 0) }}
<li>
<a href="#{{ .ID }}">{{ .ID }}. {{ .Text | firstLine }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</section>
<section class="rules">
{{ range .Sections }}
<h2 id="{{ .ID }}">{{ .ID }}. {{ .Title }}</h2>
{{ if .Extra }}
{{ if (eq .Title "Glossary")}}
<dl class="glossary">
{{ range (toGlossary .Text) }}
<dt>{{ .Keyword }}</dt>
<dd>{{ .Definition }}</dd>
{{ end }}
</dl>
{{ else }}
<p>{{ .Text | htmlify }}</p>
{{ end }}
{{ else }}
<ul>
{{ range .Rules }}
<li id="{{ .ID }}" class="depth-{{ .Depth }}">
<p>({{ .ID }}) {{ .Text | htmlify }}</p>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</section>
</main>
</body>
</html>