| {/* This is the article template. It defines how articles are formatted. */} |
| |
| {{define "root"}} |
| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>{{.Title}}</title> |
| <link type="text/css" rel="stylesheet" href="/static/article.css"> |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> |
| <meta charset='utf-8'> |
| </head> |
| |
| <body> |
| <div id="topbar" class="wide"> |
| <div class="container"> |
| <div id="heading">{{.Title}} |
| {{with .Subtitle}}{{.}}{{end}} |
| </div> |
| </div> |
| </div> |
| <div id="page" class="wide"> |
| <div class="container"> |
| {{with $toc := .Sections}} |
| <div id="toc"> |
| {{range .}}{{template "TOC" .}}{{end}} |
| </div> |
| {{end}} |
| |
| {{range .Sections}} |
| {{.HTML $.Template}} |
| {{end}}{{/* of Section block */}} |
| |
| <h2>Authors</h2> |
| {{range .Authors}} |
| <div class="author"> |
| {{range .Elem}}{{.HTML $.Template}}{{end}} |
| </div> |
| {{end}} |
| </div> |
| </div> |
| <script src='/static/playground.js'></script> |
| </body> |
| </html> |
| {{end}} |
| |
| {{define "TOC"}} |
| <ul> |
| <li><a href="#TOC_{{.FormattedNumber}}">{{.Title}}</a></li> |
| {{with .Sections}} |
| <ul> |
| {{range .}}{{template "TOC" .}}{{end}} |
| </ul> |
| {{end}} |
| </ul> |
| {{end}} |