Skip to content

Commit ef6ce39

Browse files
dvdksnclaude
andcommitted
guides: remove left sidebar on guide pages, center content, polish chrome
Guide content pages now use a clean, centered reading layout: - Drop the 320px left sidebar for the whole guides section (baseof.html conditions the desktop sidebar on type != guides; mobile drawer kept) - Remove the obsolete /guides/** -> layout: series cascade in hugo.yaml so collapsed guides route to guides/list.html instead of the old series layout - New guides/single.html + updated guides/list.html: centered reading column (max-w-[92ch]) with the TOC taking the remaining width, justify-center so the pair sits balanced rather than left-heavy - Render the guide summary as a lead paragraph under the h1 (content-default) - aside.html: auto-hide the TOC scrollbar until hover (new scrollbar-hover utility) - breadcrumbs: use an absolute font-size so they render identically inside prose (guide pages) and outside it (landing) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1a5c768 commit ef6ce39

7 files changed

Lines changed: 59 additions & 12 deletions

File tree

assets/css/utilities.css

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,33 @@
208208
}
209209
}
210210
}
211+
@utility scrollbar-hover {
212+
/* Firefox: hide the thumb until hover */
213+
scrollbar-width: thin;
214+
scrollbar-color: transparent transparent;
215+
&:hover {
216+
scrollbar-color: var(--color-gray-400) transparent;
217+
}
218+
.dark &:hover {
219+
scrollbar-color: var(--color-gray-600) transparent;
220+
}
221+
/* WebKit: reserve the track, reveal the thumb only on hover */
222+
&::-webkit-scrollbar {
223+
width: 8px;
224+
height: 8px;
225+
}
226+
&::-webkit-scrollbar-thumb {
227+
border-radius: 9999px;
228+
background-color: transparent;
229+
}
230+
&:hover::-webkit-scrollbar-thumb {
231+
background-color: var(--color-gray-400);
232+
}
233+
.dark &:hover::-webkit-scrollbar-thumb {
234+
background-color: var(--color-gray-600);
235+
}
236+
}
237+
211238
@utility chip {
212239
@apply border-divider-light dark:border-divider-dark inline-flex items-center gap-1 rounded-full border bg-gray-100 px-2 text-sm text-gray-800 select-none dark:bg-gray-700 dark:text-gray-200;
213240
}
@@ -217,7 +244,8 @@
217244
}
218245

219246
@utility breadcrumbs {
220-
font-size: 90%;
247+
/* Absolute size so breadcrumbs render identically inside and outside prose */
248+
font-size: calc(var(--text-base) * 0.9);
221249
}
222250

223251
@utility topbar-button {

hugo.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ taxonomies: {}
1313
# Cascade layout and type settings to content subtrees.
1414
# See https://gohugo.io/configuration/cascade/#target
1515
cascade:
16-
# Guide sections use the series layout (metadata card + modules list)
17-
- target:
18-
path: /guides/**
19-
kind: section
20-
layout: series
2116
# Sample pages use the samples type (routes to layouts/samples/)
2217
- target:
2318
path: /reference/samples/**

layouts/_partials/aside.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<aside
2-
class="sticky top-16 h-[calc(100vh-64px)] min-w-52 space-y-4 overflow-y-auto py-4 w-full"
2+
class="scrollbar-hover sticky top-16 h-[calc(100vh-64px)] min-w-52 space-y-4 overflow-y-auto py-4 w-full"
33
>
44
{{ partial "github-links.html" . }}
55
<div id="TableOfContents" class="overflow-x-auto">

layouts/_partials/content-default.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{{ partial "breadcrumbs.html" . }}
22
<h1 data-pagefind-weight="10">{{ .Title | safeHTML }}</h1>
3+
{{- if and (eq .Type "guides") .Params.summary }}
4+
<p class="mt-0 text-lg text-gray-500 dark:text-gray-400">
5+
{{ .Params.summary }}
6+
</p>
7+
{{- end }}
38
<div class="hidden lg:block">
49
{{ partialCached "md-dropdown.html" "-" "-" }}
510
</div>

layouts/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
}
3232
})"
33-
class="bg-background-toc dark:bg-background-toc fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto md:sticky md:top-16 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[320px]"
33+
class="bg-background-toc dark:bg-background-toc fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto{{ if ne .Type "guides" }} md:sticky md:top-16 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[320px]{{ end }}"
3434
:class="{ 'hidden': ! $store.showSidebar }"
3535
>
3636
<!-- Gray backdrop on small screens -->

layouts/guides/list.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
{{- partial "sidebar/mainnav.html" . }}
33
{{ end }}
44

5-
{{ define "article" }}
6-
<article class="prose dark:prose-invert max-w-5xl">
7-
{{ partial "content-default.html" . }}
8-
</article>
5+
{{ define "main" }}
6+
<div class="mx-auto flex w-full max-w-7xl justify-center gap-12">
7+
<article class="prose dark:prose-invert min-w-0 max-w-[92ch]">
8+
{{ partial "content-default.html" . }}
9+
</article>
10+
<div class="-mt-8 hidden w-72 flex-none lg:block">
11+
{{ partial "aside.html" . }}
12+
</div>
13+
</div>
914
{{ end }}

layouts/guides/single.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{ define "left" }}
2+
{{- partial "sidebar/mainnav.html" . }}
3+
{{ end }}
4+
5+
{{ define "main" }}
6+
<div class="mx-auto flex w-full max-w-7xl justify-center gap-12">
7+
<article class="prose dark:prose-invert min-w-0 max-w-[92ch]">
8+
{{ partial "content-default.html" . }}
9+
</article>
10+
<div class="-mt-8 hidden w-72 flex-none lg:block">
11+
{{ partial "aside.html" . }}
12+
</div>
13+
</div>
14+
{{ end }}

0 commit comments

Comments
 (0)