diff --git a/www/islands/CopyArea.tsx b/www/islands/CopyArea.tsx index 073eef3a..32065a78 100644 --- a/www/islands/CopyArea.tsx +++ b/www/islands/CopyArea.tsx @@ -4,15 +4,15 @@ import { IS_BROWSER } from "$fresh/runtime.ts"; import * as Icons from "../components/Icons.tsx"; import { useSignal } from "@preact/signals"; -export default function CopyArea(props: { children: ComponentChildren }) { +export default function CopyArea(props: { code: string }) { const copied = useSignal(false); async function handleClick() { - if (props.children === undefined || props.children === null) { + if (props.code === undefined || props.code === null) { return; } try { - await navigator.clipboard.writeText(props.children.toString()); + await navigator.clipboard.writeText(props.code.toString()); copied.value = true; } catch (error) { copied.value = false; @@ -33,7 +33,7 @@ export default function CopyArea(props: { children: ComponentChildren }) { return (
-        {props.children}
+        {props.code}
       
diff --git a/www/routes/index.tsx b/www/routes/index.tsx index a90a6a1d..6fdd4591 100644 --- a/www/routes/index.tsx +++ b/www/routes/index.tsx @@ -210,16 +210,14 @@ function GettingStarted(props: { origin: string }) { To bootstrap a new project:

- - {`deno run -A -r ${props.origin}`} - +

Enter the newly created project directory and run the following command to start the development server:

- {`deno task start`} +

You can now open{" "} diff --git a/www/routes/update.tsx b/www/routes/update.tsx index eb0900de..0a7c15e9 100644 --- a/www/routes/update.tsx +++ b/www/routes/update.tsx @@ -1,14 +1,5 @@ -import { asset, Head } from "$fresh/runtime.ts"; import { Handlers, PageProps } from "$fresh/server.ts"; -import Counter from "../islands/Counter.tsx"; -import LemonDrop from "../islands/LemonDrop.tsx"; -import Footer from "../components/Footer.tsx"; import VERSIONS from "../../versions.json" assert { type: "json" }; -import * as FeatureIcons from "../components/FeatureIcons.tsx"; -import CopyArea from "../islands/CopyArea.tsx"; -import * as Icons from "../components/Icons.tsx"; -import Projects from "../components/Projects.tsx"; -import projects from "../data/showcase.json" assert { type: "json" }; export const handler: Handlers = { GET(req) { @@ -23,266 +14,3 @@ export const handler: Handlers = { }); }, }; - -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} - - - - - - - -

- -
- - - - -
-
-
- - ); -} - -function Hero() { - return ( - <> - -
- -
- - ); -} - -function Features() { - const item = "flex md:flex-col items-center gap-5"; - const desc = "flex-1 md:text-center"; - - return ( -
-
- -
- Just-in-time rendering on the edge. -
-
- -
- -
- Island based client hydration for maximum interactivity. -
-
- -
- -
- Zero runtime overhead: no JS is shipped to the client by - default. -
-
- -
- -
- No build step. -
-
- -
- -
- No configuration necessary. -
-
- -
- -
- TypeScript support out of the box. -
-
-
- ); -} - -function Intro() { - return ( -
-
-
-

- The next-gen web framework. -

- -

- Built for speed, reliability, and simplicity. -

-
- - - deno is drinking fresh lemon squash - -
- - - -

- Fresh embraces the tried and true design of server side rendering and - progressive enhancement on the client side. -

-
- ); -} - -function GettingStarted(props: { origin: string }) { - return ( -
-

- - Getting Started - -

-
-
- -
-

- - Deno CLI - {" "} - version 1.25.0 or higher is required.{" "} - - Install - {" "} - or{" "} - - update - . -

-
-

- To bootstrap a new project: -

- - - {`deno run -A -r ${props.origin}`} - - -

- Enter the newly created project directory and run the following command - to start the development server: -

- - {`deno task start`} - -

- You can now open{" "} - - http://localhost:8000 - {" "} - in your browser to view the page. -

-

- A more in-depth{" "} - - Getting Started - {" "} - guide is available in{" "} - the docs. -

-
- ); -} - -const timeFmt = new Intl.DateTimeFormat("en-US", { - timeStyle: "long", - hour12: false, -}); - -function Example() { - return ( -
-

- - Example - -

-

- This text is being server side rendered on the fly. It was rendered at - {" "} - {timeFmt.format(new Date())}. -

-

- The counter below was rendered on the server with a starting value of 3, - and was then hydrated on the client to provide interactivity. Try out - the buttons! -

- -

- Only the JS required to render that counter is sent to the client. -

-
- ); -} - -function Showcase() { - return ( -
-

- - Showcase - -

-

- Below is a selection of projects that have been built with Fresh. -

- - -
- ); -}