chore: fix changelog page

This commit is contained in:
adamelmore
2026-01-26 11:57:59 -06:00
parent ec2ab639bb
commit 3fdd08d66e
2 changed files with 22 additions and 3 deletions

View File

@@ -31,11 +31,15 @@ type ChangelogRelease = {
sections: { title: string; items: string[] }[]
}
async function getReleases() {
function endpoint() {
const event = getRequestEvent()
const url = event ? new URL("/changelog.json", event.request.url).toString() : "/changelog.json"
if (event) return new URL("/changelog.json", event.request.url).toString()
if (!import.meta.env.SSR) return "/changelog.json"
return `${config.baseUrl}/changelog.json`
}
const response = await fetch(url).catch(() => undefined)
async function getReleases() {
const response = await fetch(endpoint()).catch(() => undefined)
if (!response?.ok) return []
const json = await response.json().catch(() => undefined)