Added most popular tag to stats page

This commit is contained in:
Brandon Rozek 2022-12-02 00:39:44 -05:00
parent 71d9811eb8
commit 5be5ad26d3

View file

@ -28,6 +28,9 @@
{{ end }}
{{ end }}
<!-- Most Popular tag -->
{{ $mostPopularTag := index .Site.Taxonomies.tags.ByCount 0 }}
{{ $wordCount := $scratch.Get "wordcount" }}
{{ $avgPostLength := div $wordCount $postCount }}
<table class="table">
@ -47,6 +50,14 @@
<td>Number of Topics</td>
<td>{{ len $tags | lang.NumFmt 0 }}</td>
</tr>
<tr>
<td>Most Popular Topic</td>
<td>
{{ with $mostPopularTag }}
<a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> with {{ .Count }} posts
{{ end }}
</td>
</tr>
<tr>
<td>Longest Post Published</td>
<td>