asw/layouts/vault/single.html
Vigilio Desto a302d81f14
docs layout: wrap sidebar+article+toc in <section data-layout="docs">
Docs and vault layouts need a wider grid container for the 3-column
layout (sidebar nav + article + TOC). Wrapped in <section> — a body
child that gets container rules but overrides to --docs-max-width.

Updated CSS selectors: aside:first-of-type → nav[data-nav="sidebar"]
to match the semantic HTML (sidebar IS navigation, not an aside).
2026-04-10 21:05:31 +02:00

95 lines
2.5 KiB
HTML

{{ define "header" }}
<header>
{{- if .Description -}}
<hgroup>
<h1>{{ .Title }}</h1>
<p>{{ .Description }}</p>
</hgroup>
{{- else -}}
<h1>{{ .Title }}</h1>
{{- end }}
</header>
{{ end }}
{{ define "content" }}
<section data-layout="docs">
<nav aria-label="Vault" data-nav="sidebar">
{{- $menuName := .Site.Params.vault_menu | default "vault" -}}
{{- $menu := index .Site.Menus $menuName -}}
{{- if $menu -}}
{{- range $menu -}}
{{- if .HasChildren -}}
<small>{{ .Name }}</small>
<ul>
{{- range .Children -}}
<li>
<a href="{{ .URL }}"
{{- if $.IsMenuCurrent $menuName . }} aria-current="page"{{ end -}}>
{{- .Name -}}
</a>
</li>
{{- end -}}
</ul>
{{- else -}}
<ul>
<li>
<a href="{{ .URL }}"
{{- if $.IsMenuCurrent $menuName . }} aria-current="page"{{ end -}}>
{{- .Name -}}
</a>
</li>
</ul>
{{- end -}}
{{- end -}}
{{- else -}}
{{- with .CurrentSection -}}
<small>{{ .Title }}</small>
<ul>
{{- range .RegularPages -}}
<li>
<a href="{{ .RelPermalink }}"
{{- if eq .RelPermalink $.RelPermalink }} aria-current="page"{{ end -}}>
{{- .LinkTitle -}}
</a>
</li>
{{- end -}}
</ul>
{{- end -}}
{{- end -}}
</nav>
<article role="main">
{{ .Content }}
{{- $prevURL := index .Params "prev-url" -}}
{{- $prevTitle := index .Params "prev-title" -}}
{{- $nextURL := index .Params "next-url" -}}
{{- $nextTitle := index .Params "next-title" -}}
{{- if or $prevURL $nextURL -}}
<footer data-role="prev-next">
{{- if $prevURL -}}
<a href="{{ $prevURL }}" rel="prev">
<small>← Previous</small>
<span>{{ $prevTitle }}</span>
</a>
{{- end -}}
{{- if and $nextURL $nextTitle -}}
<a href="{{ $nextURL }}" rel="next">
<small>Next →</small>
<span>{{ $nextTitle }}</span>
</a>
{{- end -}}
</footer>
{{- end -}}
</article>
{{- with .TableOfContents -}}
<aside data-toc>
<small>On this page</small>
{{ . }}
</aside>
{{- end -}}
</section>
{{ end }}