Hide the top bar on the home page

Visitors see the home page with no top bar at all. Signed in, the bar
sits behind a small tab at the top center that drops it down; Escape or
a click outside closes it. Every other page keeps the regular bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cdnutterandClaude Opus 5.5 committed 2026-09-30 15:27:39 -07:00
1 parent f3185ba7bd
commit 0d4bbe8c8a
3 files changed
+61 -13

No files matched your search

+26 -13
View File
@@ -15,6 +15,31 @@
</head>
<body class="{{block "bodyclass" .}}{{end}}">
<a class="skip-link" href="#main">Skip to content</a>
{{- if ne .Path "/"}}
{{template "topbar" .}}
{{- else if .LoggedIn}}
{{- /* The home page is the public face, so even signed in the bar stays
tucked away behind a small tab until it's wanted. */}}
<details class="topbar-drawer">
<summary class="topbar-tab" aria-label="Show menu" title="Menu">{{icon "chevron-down"}}</summary>
{{template "topbar" .}}
</details>
{{- end}}
<main id="main">
{{block "content" .}}{{end}}
</main>
<footer class="footer">
<div class="container footer-inner">
<span>{{if .Site.OwnerName}}Curated by {{.Site.OwnerName}}{{else}}{{.Site.Title}}{{end}}</span>
<span class="footer-sep" aria-hidden="true">·</span>
<span>Powered by <a href="https://git.iamchrisama.com/cdnutter/canon" rel="noopener">Canon</a></span>
</div>
</footer>
{{block "scripts" .}}{{end}}
</body>
</html>
{{define "topbar"}}
<header class="topbar">
<div class="topbar-inner container">
<a class="brand" href="/">
@@ -32,16 +57,4 @@
{{- end}}
</div>
</header>
<main id="main">
{{block "content" .}}{{end}}
</main>
<footer class="footer">
<div class="container footer-inner">
<span>{{if .Site.OwnerName}}Curated by {{.Site.OwnerName}}{{else}}{{.Site.Title}}{{end}}</span>
<span class="footer-sep" aria-hidden="true">·</span>
<span>Powered by <a href="https://git.iamchrisama.com/cdnutter/canon" rel="noopener">Canon</a></span>
</div>
</footer>
{{block "scripts" .}}{{end}}
</body>
</html>
{{end}}