diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-18 16:25:02 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-18 16:25:02 +0200 |
| commit | 5285459993178e6116c62583a21c52f153a47725 (patch) | |
| tree | d9a4abd8e382fa0d022bc1109f9352fdbe2b3d75 /themes/danix-xyz-hacker/layouts/_default/_markup | |
| parent | 16644e10044e75c64b0908e721648f5644296db7 (diff) | |
| download | danixxyz-5285459993178e6116c62583a21c52f153a47725.tar.gz danixxyz-5285459993178e6116c62583a21c52f153a47725.zip | |
feat: add // prefix to H2–H6 headings in prose
Render all heading levels 2–6 with a terminal-style `// ` prefix in JetBrains Mono.
H1 (page/article titles) is excluded. The prefix is aria-hidden for A11y compliance
(WCAG 2.1 AA — heading text contrast 14.72:1, prefix is decorative and exempt from
contrast requirements).
Implementation:
- New Hugo render-heading hook at _default/_markup/render-heading.html
- Added .heading-prefix CSS rule with accent purple color, 0.8em font size, 0.7 opacity
- CSS rebuil with npm run build
Applies site-wide to all markdown prose content (articles, singles, pages).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/_default/_markup')
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/_default/_markup/render-heading.html | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/themes/danix-xyz-hacker/layouts/_default/_markup/render-heading.html b/themes/danix-xyz-hacker/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..d0d5e05 --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/_default/_markup/render-heading.html @@ -0,0 +1,5 @@ +{{- if eq .Level 1 -}} +<h1 id="{{ .Anchor }}">{{ .Text | safeHTML }}</h1> +{{- else -}} +<h{{ .Level }} id="{{ .Anchor }}"><span aria-hidden="true" class="heading-prefix">//</span> {{ .Text | safeHTML }}</h{{ .Level }}> +{{- end -}} |
