Skip to content

Commit

Permalink
Fix import of lib/.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
matekdev committed Nov 11, 2023
1 parent c425235 commit 2f1d78e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions src/lib/SlugFromPath.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/routes/blog/+page.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { PageServerLoad } from './$types';
import { SlugFromPath } from '$lib/slugFromPath';

export const load: PageServerLoad = async ({ url }) => {
const modules = import.meta.glob(`/src/blogs/*.{md,svx,svelte.md}`);
Expand All @@ -8,7 +7,7 @@ export const load: PageServerLoad = async ({ url }) => {
resolver().then(
(post) =>
({
slug: SlugFromPath(path),
slug: path.match(/([\w-]+)\.(svelte\.md|md|svx)/i)?.[1] ?? null,
...(post as unknown as App.MdsvexFile).metadata
}) as App.BlogPost
)
Expand Down

0 comments on commit 2f1d78e

Please sign in to comment.