Per Pico CSS landmark pattern and HTML5 spec: - Site <header> with <nav> moved to baseof.html - Site <footer> moved to baseof.html - All section layouts (single, list, docs, paper, vault, index) now only define <main> content — no duplicate nav/footer - Article <header> stays inside <article> (different semantic role)
107 lines
3.1 KiB
HTML
107 lines
3.1 KiB
HTML
{{ define "main" }}
|
|
<main>
|
|
<div data-layout="docs">
|
|
|
|
{{/* ── Left sidebar ─────────────────────────────────────────────── */}}
|
|
|
|
<aside>
|
|
<nav aria-label="Documentation" data-nav="sidebar">
|
|
|
|
{{- $menu := index .Site.Menus "docs" -}}
|
|
{{- if $menu -}}
|
|
|
|
{{- range $menu -}}
|
|
{{- if .HasChildren -}}
|
|
<small>{{ .Name }}</small>
|
|
<ul>
|
|
{{- range .Children -}}
|
|
<li>
|
|
<a href="{{ .URL }}"
|
|
{{- if eq (relURL .URL) $.RelPermalink }} aria-current="page"{{ end -}}>
|
|
{{- .Name -}}
|
|
</a>
|
|
</li>
|
|
{{- end -}}
|
|
</ul>
|
|
{{- else -}}
|
|
<ul>
|
|
<li>
|
|
<a href="{{ .URL }}"
|
|
{{- if eq (relURL .URL) $.RelPermalink }} aria-current="page"{{ end -}}>
|
|
{{- .Name -}}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{/* Fallback: list sibling pages in the docs section */}}
|
|
{{- 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>
|
|
</aside>
|
|
|
|
|
|
{{/* ── Main content ──────────────────────────────────────────────── */}}
|
|
|
|
<article>
|
|
|
|
{{- if .Description -}}
|
|
<hgroup>
|
|
<h1>{{ .Title }}</h1>
|
|
<p>{{ .Description }}</p>
|
|
</hgroup>
|
|
{{- else -}}
|
|
<h1>{{ .Title }}</h1>
|
|
{{- end }}
|
|
|
|
{{ .Content }}
|
|
|
|
{{- if or .PrevInSection .NextInSection -}}
|
|
<div data-role="prev-next">
|
|
{{- with .NextInSection -}}
|
|
<a href="{{ .RelPermalink }}" rel="prev">
|
|
<small>← Previous</small>
|
|
<span>{{ .LinkTitle }}</span>
|
|
</a>
|
|
{{- end -}}
|
|
{{- with .PrevInSection -}}
|
|
<a href="{{ .RelPermalink }}" rel="next">
|
|
<small>Next →</small>
|
|
<span>{{ .LinkTitle }}</span>
|
|
</a>
|
|
{{- end -}}
|
|
</div>
|
|
{{- end -}}
|
|
|
|
</article>
|
|
|
|
|
|
{{/* ── Right TOC ────────────────────────────────────────────────── */}}
|
|
|
|
{{- with .TableOfContents -}}
|
|
<aside data-toc>
|
|
<small>On this page</small>
|
|
{{ . }}
|
|
</aside>
|
|
{{- end -}}
|
|
|
|
</div>
|
|
</main>
|
|
{{ end }}
|