Skip to content

Commit

Permalink
One last fix before I bring back the file
Browse files Browse the repository at this point in the history
  • Loading branch information
matekdev committed Nov 11, 2023
1 parent 2f1d78e commit 531f64d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/routes/blog/[slug]/+page.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import type { PageLoad } from './$types';
import { SlugFromPath } from '$lib/slugFromPath';
import { error } from '@sveltejs/kit';

export const load: PageLoad = async ({ params }) => {
const modules = import.meta.glob(`/src/blogs/*.{md,svx,svelte.md}`);

let match: { path?: string; resolver?: App.MdsvexResolver } = {};
for (const [path, resolver] of Object.entries(modules)) {
if (SlugFromPath(path) === params.slug) {
if ((path.match(/([\w-]+)\.(svelte\.md|md|svx)/i)?.[1] ?? null) === params.slug) {
match = { path, resolver: resolver as unknown as App.MdsvexResolver };
break;
}
Expand Down

0 comments on commit 531f64d

Please sign in to comment.