tangled
alpha
login
or
join now
e.xyehr.cn
/
standard.site
forked from
standard.site/standard.site
0
fork
atom
Standard.site landing page built in Next.js
0
fork
atom
overview
issues
pulls
pipelines
Use native anchor tags for non-docs nav links
aka.dad
1 month ago
1b2ecf35
5d5a24d9
verified
This commit was signed with the committer's
known signature
.
aka.dad
SSH Key Fingerprint:
SHA256:PdzfUZ1lVRNyVHvD1/Qf90Kh5UImYQq1TxqaDtaDqSY=
+25
-16
3 changed files
expand all
collapse all
unified
split
app
components
MobileNav.tsx
docs
DocsNav.tsx
data
docs-nav.ts
+1
-1
app/components/MobileNav.tsx
···
88
88
<div
89
89
className={ `p-4 relative flex flex-col gap-6 z-40 mx-auto max-w-[38rem] w-full min-h-0 overflow-hidden rounded-2xl transition-all duration-300 ease-in-out ${
90
90
isOpen
91
91
-
? 'bg-zinc-950 dark:bg-zinc-50 text-zinc-50 dark:text-zinc-950 h-[34rem]'
91
91
+
? 'bg-zinc-950 dark:bg-zinc-50 text-zinc-50 dark:text-zinc-950 h-[31rem]'
92
92
: 'text-base-content h-15'
93
93
}` }>
94
94
<div className="flex justify-between items-center">
+22
-13
app/components/docs/DocsNav.tsx
···
78
78
{section.title}
79
79
</span>
80
80
<div className="flex flex-col gap-2">
81
81
-
{section.items.map((item) => (
82
82
-
<Link
83
83
-
key={item.href}
84
84
-
href={item.href}
85
85
-
className={`font-medium text-lg tracking-tight ${
86
86
-
pathname === item.href
87
87
-
? 'text-zinc-50 dark:text-zinc-950'
88
88
-
: 'text-muted-content'
89
89
-
} hover:text-zinc-50 dark:hover:text-zinc-950 transition-colors`}
90
90
-
>
91
91
-
{item.label}
92
92
-
</Link>
93
93
-
))}
81
81
+
{section.items.map((item) => {
82
82
+
const isDocPage = item.href.startsWith('/docs/')
83
83
+
const className = `font-medium text-lg tracking-tight ${
84
84
+
pathname === item.href
85
85
+
? 'text-zinc-50 dark:text-zinc-950'
86
86
+
: 'text-muted-content'
87
87
+
} hover:text-zinc-50 dark:hover:text-zinc-950 transition-colors`
88
88
+
89
89
+
if (!isDocPage) {
90
90
+
return (
91
91
+
<a key={item.href} href={item.href} className={className}>
92
92
+
{item.label}
93
93
+
</a>
94
94
+
)
95
95
+
}
96
96
+
97
97
+
return (
98
98
+
<Link key={item.href} href={item.href} className={className}>
99
99
+
{item.label}
100
100
+
</Link>
101
101
+
)
102
102
+
})}
94
103
</div>
95
104
</div>
96
105
))}
+2
-2
app/data/docs-nav.ts
···
43
43
44
44
DOCS_NAV.forEach((section) => {
45
45
section.items.forEach((item) => {
46
46
-
if (!item.href.startsWith('/docs/')) return
46
46
+
if (item.href.includes('llms.txt')) return
47
47
const slug = item.href.replace('/docs/', '').split('/')
48
48
slugs.push(slug)
49
49
})
50
50
})
51
51
52
52
return slugs
53
53
-
}
53
53
+
}