This commit is contained in:
 Илья Шалонин 2025-10-29 13:43:43 +05:00
commit 8538ab969a
434 changed files with 44051 additions and 0 deletions

View file

@ -0,0 +1,25 @@
import type { Post } from "@marketing/blog/types";
import { allPosts } from "content-collections";
export async function getAllPosts(): Promise<Post[]> {
// ... add a custom loader here for your posts and map it to the post schema
return Promise.resolve(allPosts);
}
export async function getPostBySlug(
slug: string,
options?: {
locale?: string;
},
): Promise<Post | null> {
// ... add a custom loader here for your posts and map it to the post schema
return Promise.resolve(
allPosts.find(
(post) =>
post.path === slug &&
(!options?.locale || post.locale === options.locale),
) ?? null,
);
}