Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Feb 20, 2025
1 parent e14cf81 commit 62fb551
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions site/src/routes/[slug]/+page.server.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { sorted_sites } from '$lib/stores'
import sites from '$site/src/sites.yml'
import { error } from '@sveltejs/kit'
import { get } from 'svelte/store'

export const entries = () => {
// Return an array of all possible slug values
return sites.map((site) => ({ slug: site.slug }))
}

export const load = ({ params }) => {
const { slug } = params

const sites = get(sorted_sites)

const site = sites.find((site) => site.slug === slug)

if (!site) throw error(404, `Page '${slug}' not found`)
Expand Down

0 comments on commit 62fb551

Please sign in to comment.