@inherits StatiqRazorPage<IDocument>
@if (Document.ContainsKey(Keys.GroupKey))
{
  @Html.Partial("_posts.cshtml", Document.GetChildren())
  @Html.Partial("_nextprevious.cshtml", Document)
}
else
{
    @foreach (var tag in Document.GetChildren().OrderByDescending(x => x.GetChildren().Count()))
    {
        var postCount = tag.GetChildren().Count().ToString();
        <a role="button" href="@Context.GetLink(tag)" class="badge badge-light"> @tag.GetTitle() (@postCount)</a>
    }
}