portfolio_site/src/routes/vinge/+layout.server.ts
Mihkel Martin Kasterpalu ba34242475 Move projects to index, games from index to /vinge
Also move games, badges from config.ts and projects from project page
defintion to /src/lib/data
2025-01-31 18:38:44 +02:00

23 lines
454 B
TypeScript

import type { LayoutServerData } from './$types';
import { site } from '$lib/config';
import games from '$lib/data/games';
export const load: LayoutServerData = async ({ url }) => {
if (!url?.pathname) {
return;
}
const gameSlug = url.pathname.split('/').at(-1);
const game = games[gameSlug];
if (!game) {
return;
}
return {
name: game.name,
description: game.description || site.description,
image: game.image || site.image
};
};