mirror of
https://github.com/alexohneander/alexohneander-astro.git
synced 2025-06-28 14:31:52 +00:00
8 lines
265 B
TypeScript
8 lines
265 B
TypeScript
import { slugifyAll } from "./slugify";
|
|
import type { CollectionEntry } from "astro:content";
|
|
|
|
const getPostsByTag = (posts: CollectionEntry<"blog">[], tag: string) =>
|
|
posts.filter(post => slugifyAll(post.data.tags).includes(tag));
|
|
|
|
export default getPostsByTag;
|