docs: Add dependency table to maintainance page

See #8949
This commit is contained in:
Bjørn Erik Pedersen 2022-01-11 21:57:37 +01:00
parent 9af4ca3861
commit fbb3c181cb
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 35 additions and 2 deletions

View file

@ -88,6 +88,7 @@ An example table listing the dependencies:
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Owner</th>
<th scope="col">Path</th>
<th scope="col">Version</th>
<th scope="col">Time</th>
@ -98,7 +99,7 @@ An example table listing the dependencies:
{{ range $index, $element := hugo.Deps }}
<tr>
<th scope="row">{{ add $index 1 }}</th>
<td>{{ with $element.Owner }}{{.Path }}{{ else }}PROJECT{{ end }}</td>
<td>{{ with $element.Owner }}{{.Path }}{{ end }}</td>
<td>
{{ $element.Path }}
{{ with $element.Replace}}

View file

@ -7,7 +7,8 @@
<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>
<li><a href="#todos">Pages marked with TODO</a></li>
<li><a href="#dependencies">Project dependencies (Hugo Modules)</a></li>
</ul>
</aside>
</div>
@ -30,6 +31,37 @@
<h2 id="todos">Pages marked with TODO</h2>
{{ partial "maintenance-pages-table" (.Scratch.Get "todos") }}
<h2 id="dependencies">Dependencies</h2>
<table class="collapse ba br2 b--black-10 pv2 ph3">
<thead>
<tr>
<th class="pv2 ph3 tl f6 fw6 ttu">#</th>
<th class="pv2 ph3 tl f6 fw6 ttu">Owner</th>
<th class="pv2 ph3 tl f6 fw6 ttu">Path</th>
<th class="pv2 ph3 tl f6 fw6 ttu">Version</th>
<th class="pv2 ph3 tl f6 fw6 ttu">Time</th>
<th class="pv2 ph3 tl f6 fw6 ttu">Vendor</th>
</tr>
</thead>
<tbody>
{{ range $index, $element := hugo.Deps }}
<tr class="striped--light-gray">
<th class="pv2 ph3">{{ add $index 1 }}</th>
<td class="pv2 ph3">{{ with $element.Owner }}{{.Path }}{{ end }}</td>
<td class="pv2 ph3">
{{ $element.Path }}
{{ with $element.Replace}}
=> {{ .Path }}
{{ end }}
</td>
<td class="pv2 ph3">{{ $element.Version }}</td>
<td class="pv2 ph3">{{ with $element.Time }}{{ . }}{{ end }}</td>
<td class="pv2 ph3">{{ $element.Vendor }}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
</div>