Skip to content

Commit 500c7fe

Browse files
committed
docs: link playground nav item directly to v0play.vuetifyjs.com
Update AppNavLink to handle external URLs via <a> tag, and point the playground standalone nav item to the external URL instead of the internal /playground redirect page.
1 parent 7e51ad6 commit 500c7fe

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

apps/docs/build/generate-nav.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ async function generateNav (): Promise<NavItem[]> {
230230
pages.get(key)!.push(pageInfo)
231231
}
232232

233-
standalonePages.push({ item: { name: 'Playground', to: '/playground' }, order: 1.6 })
233+
standalonePages.push({ item: { name: 'Playground', to: 'https://v0play.vuetifyjs.com' }, order: 1.6 })
234234

235235
const nav: NavItem[] = []
236236
const sectionEntries = Object.entries(SECTIONS).toSorted((a, b) => a[1].order - b[1].order)

apps/docs/src/components/app/AppNavLink.vue

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
return 'expand'
5151
})
5252
53-
const isActive = toRef(() => to && (route.path === to || route.path.startsWith(`${to}/`)))
53+
const isExternal = toRef(() => !!to?.startsWith('http'))
54+
const isActive = toRef(() => !isExternal.value && to && (route.path === to || route.path.startsWith(`${to}/`)))
5455
// Check children Map directly for reactivity
5556
const childIds = toRef(() => navNested.nested.children.get(id) ?? [])
5657
const hasChildren = toRef(() => childIds.value.length > 0)
@@ -148,9 +149,26 @@
148149
<!-- Dash prefix for top-level solo links (only when collapsible nav is enabled) -->
149150
<span v-else-if="isTopLevel && !navConfig.flatMode.value" aria-hidden="true" class="size-5 shrink-0 flex items-center justify-center text-divider">–</span>
150151

151-
<!-- Link (navigable) -->
152+
<!-- External link -->
152153
<Atom
153-
v-if="to"
154+
v-if="to && isExternal"
155+
as="a"
156+
class="font-semibold icon-text flex-1 min-w-0"
157+
:class="[
158+
'hover:underline hover:text-primary focus-visible:underline focus-visible:text-primary',
159+
!isTopLevel && !hasChildren && 'opacity-70 hover:opacity-100 focus-visible:opacity-100',
160+
]"
161+
:href="to"
162+
rel="noopener"
163+
target="_blank"
164+
>
165+
<span class="truncate">{{ name }}</span>
166+
<span v-if="emphasized" class="w-2 h-2 rounded-[2px] shrink-0" :class="devmode ? 'bg-error' : 'bg-success'" />
167+
</Atom>
168+
169+
<!-- Internal link (navigable) -->
170+
<Atom
171+
v-else-if="to"
154172
:aria-current="isActive ? 'page' : undefined"
155173
:as
156174
class="font-semibold icon-text flex-1 min-w-0"

0 commit comments

Comments
 (0)