fix(web): fix doubled section prefix in doc links (404 on click)
CI / typecheck + build (turbo) (push) Canceled after 0s
CI / typecheck + build (turbo) (push) Canceled after 0s
Home page, search results, and doc page Related links all
generated hrefs as /${section}/${slug} but slug already
includes the section prefix (e.g. 'docs/websocket/contract'),
producing doubled URLs like /docs/docs/websocket/contract → 404.
Fix: href={`/${d.slug}`} everywhere.
This commit is contained in:
@@ -45,7 +45,7 @@ export default async function DocPage({
|
||||
{related.map((r) => (
|
||||
<li key={r.slug}>
|
||||
<Link
|
||||
href={`/${r.section}/${r.slug}`}
|
||||
href={`/${r.slug}`}
|
||||
className="hover:underline"
|
||||
>
|
||||
{r.title}
|
||||
|
||||
@@ -35,7 +35,7 @@ export default async function Home() {
|
||||
{docs.map((d: DocumentMeta) => (
|
||||
<li key={d.slug} className="py-2">
|
||||
<Link
|
||||
href={`/${d.section}/${d.slug}`}
|
||||
href={`/${d.slug}`}
|
||||
className="hover:underline font-medium"
|
||||
>
|
||||
{d.title}
|
||||
|
||||
@@ -71,7 +71,7 @@ export default async function SearchPage({
|
||||
className="rounded border border-zinc-200 dark:border-zinc-800 p-3"
|
||||
>
|
||||
<Link
|
||||
href={`/${h.doc.section}/${h.doc.slug}`}
|
||||
href={`/${h.doc.slug}`}
|
||||
className="font-medium hover:underline"
|
||||
>
|
||||
{h.doc.title}
|
||||
|
||||
Reference in New Issue
Block a user