-
-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Based on #566 discussion.
It would be nice to have an option to filter the collection during the build step:
const publicPosts = defineCollection({
name: "posts",
directory: "src/content/posts",
include: "**/*.md",
filter: ({level}) => level === "public"
});
const privatePosts = defineCollection({
name: "posts",
directory: "src/content/posts",
include: "**/*.md",
filter: ({level}) => level === "private"
});
or
const posts = defineCollection({
name: "posts",
directory: "src/content/posts",
include: "**/*.md",
});
const publicPosts = posts.filter(({level}) => level === "public"); // here we can potentially have `.map` if derived collection has a bit different shape
I guess filter should be after transform
step to be able to use complex conditions and features like other collections access.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request