GoBlog/templates/blogstats.gohtml

35 lines
978 B
Plaintext

{{ define "title" }}
<title>{{ with .Blog.BlogStats.Title }}{{ . }} - {{ end }}{{ .Blog.Title }}</title>
{{ end }}
{{ define "main" }}
<main>
{{ with .Blog.BlogStats.Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Blog.BlogStats.Description }}{{ md . }}{{ end }}
<table class="p">
<thead>
<tr>
<th class="tal">{{ string .Blog.Lang "year" }}</th>
<th class="tar">{{ string .Blog.Lang "count" }}</th>
</tr>
</thead>
<tbody>
{{ $counts := .Data.counts }}
{{ range $i, $year := .Data.years }}
<tr>
<td class="tal">{{ $year }}</td>
<td class="tar">{{ index $counts $i }}</td>
</tr>
{{ end }}
<tr>
<td class="tal"><b>{{ string .Blog.Lang "total" }}</b></td>
<td class="tar">{{ .Data.total }}</td>
</tr>
</tbody>
</table>
</main>
{{ end }}
{{ define "blogstats" }}
{{ template "base" . }}
{{ end }}