/** @jsx h */ /** @jsxFrag Fragment */ import { ComponentChildren, Fragment, h } from "preact"; import { asset, Head } from "$fresh/runtime.ts"; import { Handlers, PageProps } from "$fresh/server.ts"; import { tw } from "../utils/twind.ts"; import Counter from "../islands/Counter.tsx"; import LemonDrop from "../islands/LemonDrop.tsx"; import Footer from "../components/Footer.tsx"; import WarningBanner from "../components/WarningBanner.tsx"; import { Leaf } from "../components/Icons.tsx"; import VERSIONS from "../../versions.json" assert { type: "json" }; export const handler: Handlers = { GET(req, ctx) { const accept = req.headers.get("accept"); if (accept && !accept.includes("text/html")) { const path = `/@${VERSIONS[0]}/init.ts`; return new Response(`Redirecting to ${path}`, { headers: { "Location": path }, status: 307, }); } return ctx.render(); }, }; const TITLE = "fresh - The next-gen web framework."; const DESCRIPTION = "Just in time edge rendering, island based interactivity, and no configuration TypeScript support using Deno."; export default function MainPage(props: PageProps) { const ogImageUrl = new URL(asset("/home-og.png"), props.url).href; const origin = `${props.url.protocol}//${props.url.host}`; return ( <> {TITLE}