lumbung.space/themes/lumbung-theme/layouts/summary.html

43 lines
1.2 KiB
HTML
Raw Permalink Normal View History

2022-06-15 05:39:59 +00:00
{{ define "main" }}
{{/*-- post count */}}
{{ $posts := (where .Site.RegularPages "Section" "==" "posts") }}
{{ $postCount := len $posts }}
{{/*-- page count */}}
{{ $pages := (where .Site.RegularPages "Section" "==" "page") }}
{{ $pageCount := len $pages }}
<div style="overflow: auto;">
<table>
<thead>
<tr>
<td style="text-align:center;font-weight: bold;width: 10em;">Description</td>
<td style="text-align:center;font-weight: bold;">Value</td>
</tr>
</thead>
<tbody>
<tr><td>Pages</td><td>{{ $pageCount }}</td></tr>
<tr><td>Posts</td><td>{{ $postCount }}</td></tr>
<tr><td>Post by Categories</td>
<td>
{{ range $name, $taxonomy := .Site.Taxonomies.categories }}
<a href="/categories/{{ $name | urlize }}">{{ $name | humanize }} ({{ $taxonomy.Count }})</a>
&nbsp;
{{end}}
</td>
</tr>
<tr><td>Post by Tags</td>
<td>
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
<a href="/tags/{{ $name | urlize }}">#{{ $name | humanize }} ({{ $taxonomy.Count }})</a>
&nbsp;
{{end}}
</td>
</tr>
</tbody>
</table>
{{end}}