Skip to content

Commit 4c4b398

Browse files
committed
fix(docs): render the Copy page button on real docs pages and fix hydration 404s
The Copy page split button shipped in #739 never rendered: it was wired into pages/[...slug].vue while all /docs/* routes are handled by the more specific pages/docs/[...slug].vue, and it was referenced as <CopyPageDropdown /> while the auto-import name is DocsCopyPageDropdown. - Render DocsCopyPageDropdown in the title row of pages/docs/[...slug].vue - Delete the root catch-all pages/[...slug].vue: it served no content (only /docs/** exists in the content collection) and its competing route caused client-side 404s after hydration on trailing-slash docs URLs - Drop the redundant nested <article> that caused hydration mismatches on every docs page - Fix doubled item descriptions in the copy dropdown (UDropdownMenu renders item.description natively) - Remove dead layouts/default.vue + TheHeader/TheSidebar/TheTableOfContents (unused since the docs layout took over) and add the ⌘K hint to the active search button Verified with a full static build + headless-browser checks: button in the title row in light/dark, 4-item dropdown with correct .md/ChatGPT/ Claude targets, fuzzy section-level search with the AI-tip footer, and no hydration 404s on slash/no-slash hard loads.
1 parent c40b0d1 commit 4c4b398

8 files changed

Lines changed: 13 additions & 252 deletions

File tree

docs-v3/components/TheHeader.vue

Lines changed: 0 additions & 78 deletions
This file was deleted.

docs-v3/components/TheSidebar.vue

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs-v3/components/TheTableOfContents.vue

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs-v3/components/docs/CopyPageDropdown.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@
3030
</button>
3131

3232
<template #item-label="{ item }">
33-
<div class="flex flex-col text-left">
34-
<span class="text-sm font-medium text-gray-900 dark:text-white">{{ item.label }}</span>
35-
<span v-if="item.description" class="text-xs text-gray-500 dark:text-gray-400">
36-
{{ item.description }}
37-
</span>
38-
</div>
33+
<span class="text-sm font-medium text-gray-900 dark:text-white">{{ item.label }}</span>
3934
</template>
4035
</UDropdownMenu>
4136
</div>

docs-v3/components/website/WebsiteNavbar.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434

3535
<!-- Desktop search with label (docs only) -->
3636
<div v-if="isDocsPage" class="hidden lg:block">
37-
<UContentSearchButton label="Search..." :collapsed="false" />
37+
<UContentSearchButton
38+
label="Search documentation…"
39+
:kbds="['meta', 'K']"
40+
:collapsed="false"
41+
class="w-64 justify-start text-gray-500 dark:text-gray-400"
42+
/>
3843
</div>
3944

4045
<a

docs-v3/layouts/default.vue

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs-v3/pages/[...slug].vue

Lines changed: 0 additions & 63 deletions
This file was deleted.

docs-v3/pages/docs/[...slug].vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<template>
22
<NuxtLayout name="docs">
33
<div v-if="post">
4-
<article>
5-
<header class="mb-8">
4+
<header class="mb-8">
5+
<div class="flex flex-col-reverse sm:flex-row sm:items-start sm:justify-between gap-4">
66
<h1 class="text-4xl font-bold text-gray-900 dark:text-white mb-4">
77
{{ post.title }}
88
</h1>
9-
</header>
10-
11-
<div class="prose-docs">
12-
<ContentRenderer :value="post" />
9+
<DocsCopyPageDropdown class="shrink-0 sm:mt-2" />
1310
</div>
14-
</article>
11+
</header>
12+
13+
<ContentRenderer :value="post" />
1514
</div>
1615

1716
<div v-else>

0 commit comments

Comments
 (0)