mirror of
https://github.com/TrudeEH/web.git
synced 2025-12-06 08:23:37 +00:00
Add counter display for sections on home page
This commit is contained in:
@@ -28,6 +28,11 @@ code {
|
|||||||
font-family: "AdwaitaMono", monospace;
|
font-family: "AdwaitaMono", monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.counter {
|
||||||
|
color: var(--secondary);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--theme: #fafafa;
|
--theme: #fafafa;
|
||||||
--entry: #ffffff;
|
--entry: #ffffff;
|
||||||
|
|||||||
@@ -32,8 +32,18 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
<h1>{{ .title | default site.Title | markdownify }}</h1>
|
<h1>{{ .title | default site.Title | markdownify }}</h1>
|
||||||
<span>{{ .subtitle | markdownify }}</span>
|
<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 }}
|
{{- with .buttons }}
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
{{- range . }}
|
{{- range . }}
|
||||||
|
|||||||
Reference in New Issue
Block a user