import { PostCarousel } from "../../components/PostCarousel.tsx"; import { Handlers, PageProps } from "$fresh/server.ts"; import { Post } from "../../components/PostCard.tsx"; import * as hi from "jsr:@preact-icons/hi2"; interface PageData { featuredPosts: Post[]; recentPosts: Post[]; hotPosts: Post[]; popularPosts: Post[]; } export const handler: Handlers = { async GET(_, ctx) { const [featuredResult, recentResult, hotResult, popularResult] = await Promise.all([ fetch(`${Deno.env.get("BASE_URI_API")}/posts/featured`), fetch(`${Deno.env.get("BASE_URI_API")}/posts/recent`), fetch(`${Deno.env.get("BASE_URI_API")}/posts/hot`), fetch(`${Deno.env.get("BASE_URI_API")}/posts/popular`), ]); // parse all JSON responses concurrently const [featuredPosts, recentPosts, hotPosts, popularPosts] = await Promise.all([ featuredResult.json(), recentResult.json(), hotResult.json(), popularResult.json(), ]); return ctx.render({ featuredPosts, recentPosts, hotPosts, popularPosts, }); }, }; export default function PostPage({ data }: PageProps) { const { featuredPosts, recentPosts, hotPosts, popularPosts } = data; return (

Blog

Featured Posts

Ignite the impossible

Recent Posts

Now with 100% fresh perspective

Hot Posts

Making chaos look cool since forever

Popular Posts

Content may cause uncontrollable reading
); }