import { render } from "@deno/gfm"; import { Handlers, PageProps } from "$fresh/server.ts"; import { getPost, Post } from "../../lib/posts.ts"; import { LuClock } from "@preact-icons/lu"; export const handler: Handlers = { async GET(_req, ctx) { try { const post = await getPost(ctx.params.slug); return post.publishedAt ? ctx.render(post) : ctx.renderNotFound(); } catch (err) { console.error(err); return ctx.renderNotFound(); } }, }; export default function PostPage(props: PageProps) { const post = props.data; return ( <>
{/* Header section */}

{post.title}

{/* Date with clock icon */}
{/* Back button */} Back
{/* Divider line */}
{/* Content section */}
); }