Skip to content

Commit 4a2a889

Browse files
committed
Add back button
1 parent 1dae26e commit 4a2a889

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pages/_app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export default function MyApp({ Component, pageProps, router }: AppProps) {
2424
</Head>
2525

2626
<div className="w-full">
27-
<NavBar location={router.pathname}/>
27+
<NavBar location={router.asPath}/>
2828
<div className="p-4 flex flex-col w-full flex-1 px-1 md:px-20 items-center justify-center">
29-
<Component {...pageProps} location={router.pathname}/>
29+
<Component {...pageProps} location={router.asPath}/>
3030
</div>
3131
</div>
3232
<Footer />

pages/guides/[category].tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@ export default function CategoryWebpage({ guide, location }: Props & { location:
1919
<meta property="og:title" content={`${guide.name} | Hu Tao`} />
2020
<meta property="og:description" content={`View ${guide.name} guides`} />
2121
</Head>
22+
<h2 className="font-semibold">
23+
<FormattedLink href="/guides/" location={location} font="semibold" size="lg">
24+
Guides
25+
</FormattedLink>
26+
</h2>
27+
2228
<h1 className="text-3xl font-bold">
2329
{guide.name}
2430
</h1>
2531
<ul>
2632
{guide.pages.map(p => (<li key={p.name} id={urlify(p.name, false)}>
2733
<h2 className="text-2xl font-semibold">
28-
<FormattedLink href={`${urlify(guide.name, false)}/${urlify(p.name, true)}`} location={location} font="semibold" size="2xl">
34+
<FormattedLink href={`/guides/${urlify(guide.name, false)}/${urlify(p.name, true)}`} location={location} font="semibold" size="2xl">
2935
{p.name}
3036
</FormattedLink>
3137
</h2>

0 commit comments

Comments
 (0)