GoBlog/templates/blogstats.gohtml

61 lines
2.4 KiB
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>
<thead>
<tr>
<th class="tal">{{ string .Blog.Lang "year" }}</th>
<th class="tar">{{ string .Blog.Lang "posts" }}</th>
<th class="tar">~{{ string .Blog.Lang "chars" }}</th>
<th class="tar">~{{ string .Blog.Lang "words" }}</th>
<th class="tar">~{{ string .Blog.Lang "wordsperpost" }}</th>
</tr>
</thead>
<tbody>
{{ $months := .Data.months }}
{{ range $year := .Data.years }}
<tr class="statsyear" data-year="{{ $year.Name }}">
<td class="tal">{{ $year.Name }}</td>
<td class="tar">{{ $year.Posts }}</td>
<td class="tar">{{ $year.Chars }}</td>
<td class="tar">{{ $year.Words }}</td>
<td class="tar">{{ $year.WordsPerPost }}</td>
</tr>
{{ range $month := (index $months $year.Name) }}
<tr class="statsmonth hide" data-year="{{ $year.Name }}">
<td class="tal">{{ $year.Name }}-{{ $month.Name }}</td>
<td class="tar">{{ $month.Posts }}</td>
<td class="tar">{{ $month.Chars }}</td>
<td class="tar">{{ $month.Words }}</td>
<td class="tar">{{ $month.WordsPerPost }}</td>
</tr>
{{ end }}
{{ end }}
<tr>
<td class="tal">{{ string .Blog.Lang "withoutdate" }}</td>
<td class="tar">{{ .Data.withoutdate.Posts }}</td>
<td class="tar">{{ .Data.withoutdate.Chars }}</td>
<td class="tar">{{ .Data.withoutdate.Words }}</td>
<td class="tar">{{ .Data.withoutdate.WordsPerPost }}</td>
</tr>
<tr>
<td class="tal"><b>{{ string .Blog.Lang "total" }}</b></td>
<td class="tar">{{ .Data.total.Posts }}</td>
<td class="tar">{{ .Data.total.Chars }}</td>
<td class="tar">{{ .Data.total.Words }}</td>
<td class="tar">{{ .Data.total.WordsPerPost }}</td>
</tr>
</tbody>
</table>
<script defer src="{{ asset "js/blogstats.js" }}"></script>
</main>
{{ end }}
{{ define "blogstats" }}
{{ template "base" . }}
{{ end }}