Skip to content

Commit

Permalink
Merge pull request #33 from johnhooks/fix/slugify-all-typo
Browse files Browse the repository at this point in the history
fix: slugifyAll typo
  • Loading branch information
satnaing authored Feb 10, 2023
2 parents e74267f + bcae985 commit df5aa58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/utils/getPostsByTag.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { slufigyAll } from "./slugify";
import { slugifyAll } from "./slugify";
import type { CollectionEntry } from "astro:content";

const getPostsByTag = (posts: CollectionEntry<"blog">[], tag: string) =>
posts.filter(post => slufigyAll(post.data.tags).includes(tag));
posts.filter(post => slugifyAll(post.data.tags).includes(tag));

export default getPostsByTag;
2 changes: 1 addition & 1 deletion src/utils/slugify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export const slugifyStr = (str: string) => slugger(str);
const slugify = (post: BlogFrontmatter) =>
post.postSlug ? slugger(post.postSlug) : slugger(post.title);

export const slufigyAll = (arr: string[]) => arr.map(str => slugifyStr(str));
export const slugifyAll = (arr: string[]) => arr.map(str => slugifyStr(str));

export default slugify;

0 comments on commit df5aa58

Please sign in to comment.