maintenance: Add TODO list

And add the section to the menu.
This commit is contained in:
Bjørn Erik Pedersen 2018-02-11 16:15:06 +01:00
parent 3b5f27835e
commit bf93a46eaa
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
2 changed files with 17 additions and 2 deletions

View File

@ -1,9 +1,12 @@
---
title: Documentation Maintenance Lists
title: Maintenance
description: Some lists useful for the maintenance of the Hugo docs site.
date: 2018-02-09
categories: [maintenance]
keywords: [maintenance]
menu:
docs:
weight: 200
slug:
aliases: []
toc: true

View File

@ -7,17 +7,29 @@
<ul>
<li><a href="#last-updated">Last Updated</a></li>
<li><a href="#least-recently-updated">Least Recently Updated</a></li>
<li><a href="#todos">Pages marked with TODO</a></li>
</ul>
</aside>
</div>
<div class="w-100">
{{ $byLastMod := .Site.RegularPages.ByLastmod }}
{{ $recent := ($byLastMod | last 10).Reverse }}
{{ $leastRecent := $byLastMod | first 10 }}
{{ $leastRecent := $byLastMod | first 10 }}
<h2 id="last-updated">Last Updated</h2>
{{ partial "maintenance-pages-table" $recent }}
<h2 id="least-recently-updated">Least Recently Updated</h2>
{{ partial "maintenance-pages-table" $leastRecent }}
{{/* Don't think this is possible with where directly. Should investigate. */}}
{{ .Scratch.Set "todos" slice }}
{{ range .Site.RegularPages }}
{{ if .HasShortcode "todo" }}
{{ $.Scratch.Add "todos" . }}
{{ end }}
{{ end }}
<h2 id="todos">Pages marked with TODO</h2>
{{ partial "maintenance-pages-table" (.Scratch.Get "todos") }}
</div>
</div>
</div>