import type { create_ssr_component } from 'svelte/internal';

export type Mdsvex = {
	metadata: {
		title: string;
		description?: string;
		date?: string;
		tags?: string[];
	};
	default: ReturnType<typeof create_ssr_component>;
};

export const shs = new Map(
	Object.entries(
		import.meta.glob<Mdsvex>('../routes/shs/*/*{.md,.svelte,+page.md.index.svelte}')
	).map(([path, load]) => [
		path
			.replace(/(\+page\.md|\.svelte|\/index\.md|\/index\.svelte)$/, '')
			.replace(/^\.\.\/routes/, ''),
		load
	])
);
