Skip to content

Commit 55c4dc4

Browse files
committed
fix: add trailing slashes to all internal links
All internal links were missing trailing slashes, causing 308 redirects on every navigation. Fixes /docs, /docs/paragraphs, /docs/tables, etc across Sidebar, Navbar, Home, MCP, and 404 pages.
1 parent 7168a4b commit 55c4dc4

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

apps/web/src/components/Navbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function Navbar({ sticky = false, maxWidth = false, onSearchClick }: Navb
3131

3232
{/* Desktop navigation */}
3333
<nav className="hidden items-center gap-4 sm:flex">
34-
<NavLink to="/docs" active={isDocsActive}>
34+
<NavLink to="/docs/" active={isDocsActive}>
3535
Reference
3636
</NavLink>
3737
<div className="flex items-center gap-1">
@@ -81,7 +81,7 @@ export function Navbar({ sticky = false, maxWidth = false, onSearchClick }: Navb
8181
{/* Mobile menu */}
8282
{mobileMenuOpen && (
8383
<nav className="mt-3 flex flex-col gap-1 border-t border-[var(--color-border)] pt-3 sm:hidden">
84-
<NavLink to="/docs" active={isDocsActive} onClick={() => setMobileMenuOpen(false)}>
84+
<NavLink to="/docs/" active={isDocsActive} onClick={() => setMobileMenuOpen(false)}>
8585
Reference
8686
</NavLink>
8787
<div className="flex items-center gap-1">

apps/web/src/components/Sidebar.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ import { Link, useLocation } from "react-router-dom";
55
const NAV_SECTIONS = [
66
{
77
title: "Getting Started",
8-
items: [{ to: "/docs", label: "Introduction", path: "index" }],
8+
items: [{ to: "/docs/", label: "Introduction", path: "index" }],
99
},
1010
{
1111
title: "WordprocessingML",
1212
items: [
13-
{ to: "/docs/paragraphs", label: "Paragraphs", path: "paragraphs" },
13+
{ to: "/docs/paragraphs/", label: "Paragraphs", path: "paragraphs" },
1414
{
15-
to: "/docs/paragraph-borders",
15+
to: "/docs/paragraph-borders/",
1616
label: "Paragraph Borders",
1717
path: "paragraph-borders",
1818
},
1919
{
20-
to: "/docs/bidirectional-text",
20+
to: "/docs/bidirectional-text/",
2121
label: "Bidirectional Text (RTL)",
2222
path: "bidirectional-text",
2323
isNew: true,
2424
},
25-
{ to: "/docs/tables", label: "Tables", path: "tables" },
26-
{ to: "/docs/styles", label: "Styles", path: "styles", disabled: true },
25+
{ to: "/docs/tables/", label: "Tables", path: "tables" },
26+
{ to: "/docs/styles/", label: "Styles", path: "styles", disabled: true },
2727
],
2828
},
2929
{
3030
title: "Guides",
3131
items: [
32-
{ to: "/docs/creating-documents", label: "Creating Documents", path: "creating-documents" },
33-
{ to: "/docs/common-gotchas", label: "Common Gotchas", path: "common-gotchas" },
32+
{ to: "/docs/creating-documents/", label: "Creating Documents", path: "creating-documents" },
33+
{ to: "/docs/common-gotchas/", label: "Common Gotchas", path: "common-gotchas" },
3434
],
3535
},
3636
];

apps/web/src/pages/Home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function Home() {
2222
</p>
2323
<div className="flex justify-center gap-4 mb-6">
2424
<Link
25-
to="/docs"
25+
to="/docs/"
2626
className="rounded-lg bg-[var(--color-accent)] px-5 py-2.5 font-medium text-white transition hover:bg-[var(--color-accent-hover)] sm:px-6 sm:py-3"
2727
>
2828
Browse Reference
@@ -38,7 +38,7 @@ export function Home() {
3838
Bidirectional Text — RTL layout, logical alignment, tab stop flipping, and bidi pitfalls
3939
</span>
4040
<Link
41-
to="/docs/bidirectional-text"
41+
to="/docs/bidirectional-text/"
4242
className="text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] font-medium text-xs"
4343
>
4444
Read it →

apps/web/src/pages/Mcp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export function Mcp() {
237237
</a>
238238
</span>
239239
<Link
240-
to="/docs"
240+
to="/docs/"
241241
className="text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)]"
242242
>
243243
Back to Docs →

apps/web/src/pages/NotFound.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function NotFound() {
2323
Go to Homepage
2424
</Link>
2525
<Link
26-
to="/docs"
26+
to="/docs/"
2727
className="rounded-lg border border-[var(--color-border)] px-5 py-2.5 font-medium text-[var(--color-text-primary)] transition hover:bg-[var(--color-bg-secondary)]"
2828
>
2929
Browse Docs

0 commit comments

Comments
 (0)