We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f641767 + e90714b commit efdf418Copy full SHA for efdf418
src/utils/blog.ts
@@ -11,7 +11,7 @@ const getNormalizedPost = async (post: CollectionEntry<'blog'>): Promise<Post> =
11
12
return {
13
id: id,
14
- slug: cleanSlug(slug.split('/').pop() ?? ''),
+ slug: cleanSlug(slug.split('/').pop()),
15
16
publishDate: new Date(publishDate),
17
category: cleanSlug(category),
src/utils/permalinks.ts
@@ -14,7 +14,7 @@ const createPath = (...params: string[]) => {
const BASE_PATHNAME = SITE.basePathname;
-export const cleanSlug = (text: string) =>
+export const cleanSlug = (text = '') =>
18
trimSlash(text)
19
.split('/')
20
.map((slug) => slugify(slug))
0 commit comments