import PageFooter from "../components/Footer.tsx"; import Header from "../components/Header.tsx"; import ComponentGallery from "../islands/ComponentGallery.tsx"; import { asset, Head } from "$fresh/runtime.ts"; import { Handlers, PageProps } from "$fresh/server.ts"; function getSource(path: string) { return Deno.readTextFile(new URL(path, import.meta.url)); } export const handler: Handlers = { async GET(req, ctx) { const props: HomeProps = { sources: { "Button": await getSource("../components/gallery/Button.tsx"), "LinkButton": await getSource("../components/gallery/LinkButton.tsx"), "ColoredButton": await getSource( "../components/gallery/ColoredButton.tsx", ), "Input": await getSource("../components/gallery/Input.tsx"), "Header": await getSource("../components/gallery/Header.tsx"), "Footer": await getSource("../components/gallery/Footer.tsx"), "Hero": await getSource("../components/gallery/Hero.tsx"), "Features": await getSource("../components/gallery/Features.tsx"), "Carousel": await getSource("../components/gallery/Carousel.tsx"), }, }; return ctx.render(props); }, }; const TITLE = "Components | Fresh"; const DESCRIPTION = "A collection of components made for Fresh."; interface HomeProps { sources: Record; } export default function Home(props: PageProps) { const ogImageUrl = new URL(asset("/home-og.png"), props.url).href; return (
{TITLE}

Fresh Components

A collection of components made for Fresh.

); }