dati

A Go library/binary to parse & execute data against template langauges.
git clone git://src.gearsix.net/datidati.zip
Log | Files | Refs | Atom | README | LICENSE

html.hmpl (raw) (749B)


   1 <!DOCTYPE html>
   2 <html lang="en">
   3   <head>
   4     <title>{{.Title}}</title>
   5     <meta charset="UTF-8" />
   6     <meta name="author" content="{{.Author}}" />
   7     <meta name="description" content="{{.Description}}" />
   8   </head>
   9   <body>
  10     <h1>{{.Title}}</h1>
  11     <p>
  12       {{.Description}}
  13       <address>{{.Author}}</address>
  14     </p>
  15 
  16     <main>{{range $i, $l := .logfiles}}
  17       <hr />
  18 
  19       <dl>
  20         <dt><b>Stardate:</b></dt><dd>{{$l.Stardate}}</dd>
  21         <dt><b>Starship:</b></dt><dd>{{$l.Starship}}</dd>
  22         <dt><b>Captain:</b></dt><dd>{{$l.Captain}}</dd>
  23       </dl>{{if $l.Logs}}{{$nlogs := len $l.Logs}}{{range $n, $log := $l.Logs}}
  24       <p>{{$log}}</p>{{end}}{{else}}<p>&lt;no entries&gt;{{end}}
  25     {{end}}</main>
  26   </body>
  27 </html>