mirror of
https://github.com/TrudeEH/web.git
synced 2025-12-06 00:13:36 +00:00
Add counter display for sections on home page
This commit is contained in:
@@ -28,6 +28,11 @@ code {
|
||||
font-family: "AdwaitaMono", monospace;
|
||||
}
|
||||
|
||||
.counter {
|
||||
color: var(--secondary);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
:root {
|
||||
--theme: #fafafa;
|
||||
--entry: #ffffff;
|
||||
|
||||
@@ -32,8 +32,18 @@
|
||||
{{- end }}
|
||||
<h1>{{ .title | default site.Title | markdownify }}</h1>
|
||||
<span>{{ .subtitle | markdownify }}</span>
|
||||
{{- partial "social_icons.html" -}}
|
||||
|
||||
<!-- Counter -->
|
||||
{{- $grouped := site.RegularPages.GroupBy "Section" -}}
|
||||
{{- $counters := slice -}}
|
||||
{{- range $group := $grouped -}}
|
||||
{{- if $group.Key -}}
|
||||
{{- $counters = $counters | append (printf "%s: %d" (title $group.Key) (len $group.Pages)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<span class="counter">{{ delimit $counters " • " }}</span>
|
||||
|
||||
{{- partial "social_icons.html" -}}
|
||||
{{- with .buttons }}
|
||||
<div class="buttons">
|
||||
{{- range . }}
|
||||
|
||||
Reference in New Issue
Block a user