Skip to content

Commit 6edf80e

Browse files
committed
fix(docs): really fix the links in Advent of CALM, and make dev mirror prod behaviour
1 parent 7ffdec0 commit 6edf80e

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

advent-of-calm/website/astro.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export default defineConfig({
66
outDir: './dist',
77
build: {
88
format: 'directory'
9-
}
9+
},
10+
trailingSlash: 'always'
1011
});

advent-of-calm/website/src/components/Calendar.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const days = getAllDays();
77
<div class="calendar-grid" id="calendar-grid">
88
{days.map(({ day, unlocked, title }) => (
99
<a
10-
href={unlocked ? `./day/${day}` : '#'}
10+
href={unlocked ? `day/${day}/` : '#'}
1111
class:list={['calendar-day', { locked: !unlocked, unlocked }]}
1212
title={unlocked ? title : `Unlocks December ${day}`}
1313
aria-disabled={!unlocked}
@@ -117,7 +117,7 @@ const days = getAllDays();
117117
const dayElement = day as HTMLElement;
118118
dayElement.classList.remove('locked');
119119
dayElement.classList.add('unlocked');
120-
dayElement.setAttribute('href', `./day/${dayNumber}`);
120+
dayElement.setAttribute('href', `day/${dayNumber}/`);
121121
dayElement.removeAttribute('aria-disabled');
122122
dayElement.style.pointerEvents = 'auto';
123123
dayElement.style.cursor = 'pointer';

advent-of-calm/website/src/pages/day/[day].astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const nextUnlocked = nextDay && isUnlocked(nextDay);
2626
<nav class="day-nav">
2727
<div class="nav-left">
2828
{prevDay && (
29-
<a href={`${prevDay}`} class="nav-button prev">
29+
<a href={`../${prevDay}/`} class="nav-button prev">
3030
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
3131
<path d="M15 18l-6-6 6-6"/>
3232
</svg>
@@ -35,11 +35,11 @@ const nextUnlocked = nextDay && isUnlocked(nextDay);
3535
)}
3636
</div>
3737
<div class="nav-center">
38-
<a href="../" class="nav-button home">Calendar</a>
38+
<a href="../../" class="nav-button home">Calendar</a>
3939
</div>
4040
<div class="nav-right">
4141
{nextDay && nextUnlocked && (
42-
<a href={`${nextDay}`} class="nav-button next">
42+
<a href={`../${nextDay}/`} class="nav-button next">
4343
Day {nextDay}
4444
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
4545
<path d="M9 18l6-6-6-6"/>
@@ -65,7 +65,7 @@ const nextUnlocked = nextDay && isUnlocked(nextDay);
6565
<nav class="day-nav bottom">
6666
<div class="nav-left">
6767
{prevDay && (
68-
<a href={`${prevDay}`} class="nav-button prev">
68+
<a href={`../${prevDay}/`} class="nav-button prev">
6969
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
7070
<path d="M15 18l-6-6 6-6"/>
7171
</svg>
@@ -74,11 +74,11 @@ const nextUnlocked = nextDay && isUnlocked(nextDay);
7474
)}
7575
</div>
7676
<div class="nav-center">
77-
<a href="../" class="nav-button home">Back to Calendar</a>
77+
<a href="../../" class="nav-button home">Back to Calendar</a>
7878
</div>
7979
<div class="nav-right">
8080
{nextDay && nextUnlocked && (
81-
<a href={`${nextDay}`} class="nav-button next">
81+
<a href={`../${nextDay}/`} class="nav-button next">
8282
Day {nextDay}
8383
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
8484
<path d="M9 18l6-6-6-6"/>

0 commit comments

Comments
 (0)