hypnagaga/bin/mods/make-ai-embed/templates/+page.server.ts
Ben Aultowski 04877468cf initial
2026-02-27 11:58:02 -05:00

19 lines
456 B
TypeScript

import type { PageServerLoad } from './$types';
import { story } from '$locales/en/embeds.json';
interface Embed {
locale: string;
slug: string;
title?: string;
description?: string;
notes?: string;
altText?: string;
}
export const load: PageServerLoad = ({ route }) => {
const embed = (story.embeds as Embed[]).find(({ locale, slug }) => {
return route.id === `/embeds/${locale?.trim()}/${slug?.trim()}`;
});
return { embed };
};