Skip to content

Commit f1c6f0e

Browse files
committed
Fix navigation links
1 parent 3eb23eb commit f1c6f0e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/layouts/MarkdownLayout.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ const hasNavigation = frontmatter.prev !== null || frontmatter.next !== null;
1919
<div class="mt-4 pt-4 flex flex-row justify-between border-t-1 border-t-neutral-200">
2020
{frontmatter.prev != null && (
2121
<a
22-
href={frontmatter.prev.path}
22+
href={new URL(frontmatter.prev.path, Astro.url).pathname}
2323
class="px-4 py-2 border-1 border-neutral-400 rounded-md !no-underline"
2424
>
2525
{frontmatter.prev.name}
2626
</a>
2727
)}
2828
{frontmatter.next != null && (
2929
<a
30-
href={frontmatter.next.path}
30+
href={new URL(frontmatter.next.path, Astro.url).pathname}
3131
class="px-4 py-2 border-1 border-neutral-400 rounded-md !no-underline"
3232
>
3333
{frontmatter.next.name}
@@ -44,7 +44,7 @@ const hasNavigation = frontmatter.prev !== null || frontmatter.next !== null;
4444
<a
4545
class={`inline-block w-full text-sm text-sky-300`}
4646
style={`margin-left: ${(depth - 2) * 8}px`}
47-
href={`#${slug}`}
47+
href={`${Astro.url}#${slug}`}
4848
>
4949
{text}
5050
</a>

src/pages/setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
layout: ../layouts/MarkdownLayout.astro
33
title: Setup
44
prev:
5-
path: /
5+
path: .
66
name: Home
77
next:
8-
path: /lessons
8+
path: lessons
99
name: Lessons
1010
---
1111

0 commit comments

Comments
 (0)