---
import PostHero from "../components/PostHero.astro";
import PostFooter from "../components/PostFooter.astro";
import { getFeaturedPosts, invariant, type Post, type Settings } from "@matthiesenxyz/astro-ghostcms/api";
import { Markup } from 'astro-remote';
import * as render from '../components/astro-remote';
export type Props = {
post: Post;
settings: Settings;
posts: Post[];
};
const { post, settings, posts } = Astro.props as Props;
async function getPostsSet(){
const featuredPosts = await getFeaturedPosts();
const fposts = posts;
if(featuredPosts.posts.length === 0){ return fposts }
else {
const featured = featuredPosts.posts[0]
return fposts.filter((p: Post)=>p.id !== featured.id)
}
}
const mPosts = await getPostsSet()
invariant(settings, "Settings not found");
---