drop <main>, use <article role="main"> — bold landmark structure
body direct children: <nav>, <header>, <article role="main">, <footer> - <nav>: site navigation (own landmark) - <header>: page identity — title, author, date, metadata - <article role="main">: content (screen reader gets landmark via role) - <footer>: site footer No <main> wrapper. Fewer tags, clearer signal. Header block defined per-layout (prose gets eyebrow/date, docs gets hgroup). Content block defined per-layout (docs adds sidebar <nav> + <aside> TOC).
This commit is contained in:
parent
169374e2fd
commit
c2261bfc9f
7 changed files with 291 additions and 357 deletions
|
|
@ -4,10 +4,9 @@
|
|||
{{- partial "head.html" . -}}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
{{ partial "nav.html" . }}
|
||||
</header>
|
||||
{{ block "main" . }}{{ end }}
|
||||
{{ block "header" . }}{{ end }}
|
||||
{{ block "content" . }}{{ end }}
|
||||
<footer>
|
||||
<small><a href="/">{{ .Site.Title }}</a> · {{ now.Format "2006" }}</small>
|
||||
</footer>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<article data-layout="prose">
|
||||
|
||||
{{ define "header" }}
|
||||
<header>
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Description }}<p>{{ . }}</p>{{ end }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<article role="main">
|
||||
<section>
|
||||
{{ range .Pages }}
|
||||
<article>
|
||||
|
|
@ -20,7 +20,5 @@
|
|||
</article>
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<article data-layout="prose">
|
||||
|
||||
{{ define "header" }}
|
||||
<header>
|
||||
<hgroup>
|
||||
{{ with .Params.eyebrow }}<p data-text="eyebrow">{{ . }}</p>{{ end }}
|
||||
|
|
@ -9,17 +6,19 @@
|
|||
{{ with .Description }}<p>{{ . }}</p>{{ end }}
|
||||
</hgroup>
|
||||
<p data-text="dim">
|
||||
<time datetime="{{ .Date.Format `2006-01-02` }}">{{ .Date.Format "January 2006" }}</time>
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2006" }}</time>
|
||||
{{ with .Params.author }} · {{ . }}{{ end }}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
<footer>
|
||||
<small>{{ with .Params.footer }}{{ . }}{{ else }}Published in the dorveille.{{ end }}</small>
|
||||
</footer>
|
||||
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<article role="main">
|
||||
{{ .Content }}
|
||||
{{ with .Params.footer }}
|
||||
<footer>
|
||||
<small>{{ . }}</small>
|
||||
</footer>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,21 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<div data-layout="docs">
|
||||
{{ define "header" }}
|
||||
<header>
|
||||
{{- if .Description -}}
|
||||
<hgroup>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p>{{ .Description }}</p>
|
||||
</hgroup>
|
||||
{{- else -}}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{- end }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{/* ── Left sidebar ─────────────────────────────────────────────── */}}
|
||||
|
||||
<aside>
|
||||
{{ define "content" }}
|
||||
{{/* Docs sidebar — this is navigation, not an aside */}}
|
||||
<nav aria-label="Documentation" data-nav="sidebar">
|
||||
|
||||
{{- $menu := index .Site.Menus "docs" -}}
|
||||
{{- if $menu -}}
|
||||
|
||||
{{- range $menu -}}
|
||||
{{- if .HasChildren -}}
|
||||
<small>{{ .Name }}</small>
|
||||
|
|
@ -34,10 +40,7 @@
|
|||
</ul>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- else -}}
|
||||
|
||||
{{/* Fallback: list sibling pages in the docs section */}}
|
||||
{{- with .CurrentSection -}}
|
||||
<small>{{ .Title }}</small>
|
||||
<ul>
|
||||
|
|
@ -51,30 +54,14 @@
|
|||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
|
||||
{{/* ── Main content ──────────────────────────────────────────────── */}}
|
||||
|
||||
<article>
|
||||
|
||||
{{- if .Description -}}
|
||||
<hgroup>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p>{{ .Description }}</p>
|
||||
</hgroup>
|
||||
{{- else -}}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{- end }}
|
||||
|
||||
<article role="main">
|
||||
{{ .Content }}
|
||||
|
||||
{{- if or .PrevInSection .NextInSection -}}
|
||||
<div data-role="prev-next">
|
||||
<footer data-role="prev-next">
|
||||
{{- with .NextInSection -}}
|
||||
<a href="{{ .RelPermalink }}" rel="prev">
|
||||
<small>← Previous</small>
|
||||
|
|
@ -87,21 +74,14 @@
|
|||
<span>{{ .LinkTitle }}</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</footer>
|
||||
{{- end -}}
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
{{/* ── Right TOC ────────────────────────────────────────────────── */}}
|
||||
|
||||
{{- with .TableOfContents -}}
|
||||
<aside data-toc>
|
||||
<small>On this page</small>
|
||||
{{ . }}
|
||||
</aside>
|
||||
{{- end -}}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
{{ define "title" }}{{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
<article data-layout="prose">
|
||||
|
||||
{{ define "header" }}
|
||||
<header>
|
||||
<hgroup>
|
||||
<h1>{{ .Site.Title }}</h1>
|
||||
<p>{{ .Site.Params.description | default "An agent-first approach to web generation." }}</p>
|
||||
</hgroup>
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<article role="main">
|
||||
<section>
|
||||
<h2>Recent</h2>
|
||||
{{ range first 10 .Site.RegularPages }}
|
||||
|
|
@ -26,7 +26,5 @@
|
|||
</article>
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,7 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<article data-paper>
|
||||
|
||||
{{ define "header" }}
|
||||
<header>
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{- with .Description -}}
|
||||
<p data-abstract>{{ . }}</p>
|
||||
{{- end -}}
|
||||
|
||||
{{/* Byline: date and/or author */}}
|
||||
{{ with .Description }}<p data-abstract>{{ . }}</p>{{ end }}
|
||||
{{- $hasDate := not .Date.IsZero -}}
|
||||
{{- $hasAuthor := .Params.author -}}
|
||||
{{- if or $hasDate $hasAuthor -}}
|
||||
|
|
@ -18,42 +9,32 @@
|
|||
{{- if $hasDate -}}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time>
|
||||
{{- end -}}
|
||||
{{- if and $hasDate $hasAuthor -}}
|
||||
<span aria-hidden="true"> · </span>
|
||||
{{- end -}}
|
||||
{{- with .Params.author -}}
|
||||
<span>{{ . }}</span>
|
||||
{{- end -}}
|
||||
{{- if and $hasDate $hasAuthor }} · {{ end -}}
|
||||
{{- with .Params.author }}{{ . }}{{ end -}}
|
||||
</p>
|
||||
{{- end -}}
|
||||
|
||||
{{/* Tags */}}
|
||||
{{- with .GetTerms "tags" -}}
|
||||
{{- end }}
|
||||
{{- with .GetTerms "tags" }}
|
||||
<nav data-role="tag-cloud" aria-label="Tags">
|
||||
{{- range . -}}
|
||||
{{- range . }}
|
||||
<a href="{{ .Permalink }}" data-tag="{{ .Name }}">{{ .Name }}</a>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{- end -}}
|
||||
|
||||
{{- end }}
|
||||
</header>
|
||||
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
|
||||
{{/* ── Prev / Next footer ──────────────────────────────────────── */}}
|
||||
{{- if or .PrevInSection .NextInSection -}}
|
||||
<footer>
|
||||
{{- with .PrevInSection -}}
|
||||
<a href="{{ .RelPermalink }}" rel="prev">← {{ .LinkTitle }}</a>
|
||||
{{- end -}}
|
||||
{{- with .NextInSection -}}
|
||||
<a href="{{ .RelPermalink }}" rel="next">{{ .LinkTitle }} →</a>
|
||||
{{- end -}}
|
||||
</footer>
|
||||
{{- end -}}
|
||||
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<article role="main">
|
||||
{{ .Content }}
|
||||
{{- if or .PrevInSection .NextInSection }}
|
||||
<footer>
|
||||
{{- with .PrevInSection }}
|
||||
<a href="{{ .RelPermalink }}" rel="prev">← {{ .LinkTitle }}</a>
|
||||
{{- end }}
|
||||
{{- with .NextInSection }}
|
||||
<a href="{{ .RelPermalink }}" rel="next">{{ .LinkTitle }} →</a>
|
||||
{{- end }}
|
||||
</footer>
|
||||
{{- end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,22 @@
|
|||
{{ define "main" }}
|
||||
<main>
|
||||
<div data-layout="docs">
|
||||
{{ define "header" }}
|
||||
<header>
|
||||
{{- if .Description -}}
|
||||
<hgroup>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p>{{ .Description }}</p>
|
||||
</hgroup>
|
||||
{{- else -}}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{- end }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{/* ── Left sidebar ─────────────────────────────────────────────── */}}
|
||||
|
||||
<aside>
|
||||
{{ define "content" }}
|
||||
{{/* Vault sidebar navigation */}}
|
||||
<nav aria-label="Vault" data-nav="sidebar">
|
||||
{{- $menuName := .Site.Params.vault_menu | default "vault" -}}
|
||||
<nav aria-label="Vault documentation" data-nav="sidebar">
|
||||
|
||||
{{- $menu := index .Site.Menus $menuName -}}
|
||||
{{- if $menu -}}
|
||||
|
||||
{{- range $menu -}}
|
||||
{{- if .HasChildren -}}
|
||||
<small>{{ .Name }}</small>
|
||||
|
|
@ -35,10 +41,7 @@
|
|||
</ul>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- else -}}
|
||||
|
||||
{{/* Fallback: list direct pages of the current section */}}
|
||||
{{- with .CurrentSection -}}
|
||||
<small>{{ .Title }}</small>
|
||||
<ul>
|
||||
|
|
@ -52,35 +55,18 @@
|
|||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
|
||||
{{/* ── Main content ──────────────────────────────────────────────── */}}
|
||||
|
||||
<article>
|
||||
|
||||
{{- if .Description -}}
|
||||
<hgroup>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p>{{ .Description }}</p>
|
||||
</hgroup>
|
||||
{{- else -}}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{- end }}
|
||||
|
||||
<article role="main">
|
||||
{{ .Content }}
|
||||
|
||||
{{/* ── Prev / Next — from front matter, not Hugo section order ── */}}
|
||||
{{- $prevURL := index .Params "prev-url" -}}
|
||||
{{- $prevTitle := index .Params "prev-title" -}}
|
||||
{{- $nextURL := index .Params "next-url" -}}
|
||||
{{- $nextTitle := index .Params "next-title" -}}
|
||||
{{- if or $prevURL $nextURL -}}
|
||||
<div data-role="prev-next">
|
||||
<footer data-role="prev-next">
|
||||
{{- if $prevURL -}}
|
||||
<a href="{{ $prevURL }}" rel="prev">
|
||||
<small>← Previous</small>
|
||||
|
|
@ -93,21 +79,14 @@
|
|||
<span>{{ $nextTitle }}</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</footer>
|
||||
{{- end -}}
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
{{/* ── Right TOC ────────────────────────────────────────────────── */}}
|
||||
|
||||
{{- with .TableOfContents -}}
|
||||
<aside data-toc>
|
||||
<small>On this page</small>
|
||||
{{ . }}
|
||||
</aside>
|
||||
{{- end -}}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue