diff --git a/docs/concepts/middleware.md b/docs/concepts/middleware.md index f3bba39f..028ec329 100644 --- a/docs/concepts/middleware.md +++ b/docs/concepts/middleware.md @@ -1,3 +1,9 @@ +--- +description: | + Add middleware routes to intercept requests or responses for analytics + purposes, access control, or anything else. +--- + A middleware is defined in a `_middleware.ts` file. It will intercept the request in order for you to perform custom logic before or after the route handler. This allows modifying or checking requests and responses. Common diff --git a/docs/getting-started/adding-interactivity.md b/docs/getting-started/adding-interactivity.md index f767bd8c..f0491ebc 100644 --- a/docs/getting-started/adding-interactivity.md +++ b/docs/getting-started/adding-interactivity.md @@ -1,3 +1,9 @@ +--- +description: | + Add JavaScript based interactivity to your project without sacrificing user + experience, by using fresh's powerful islands system. +--- + Up to now none of the pages in the demo project have contained any client side JavaScript. This is great for resiliency and performance, but it can also limit the possibilities of interactivity. In many current generation web frameworks, diff --git a/docs/getting-started/create-a-project.md b/docs/getting-started/create-a-project.md index db768f4c..5f7a9b91 100644 --- a/docs/getting-started/create-a-project.md +++ b/docs/getting-started/create-a-project.md @@ -1,3 +1,9 @@ +--- +description: | + Create a new fresh project by running `fresh init`. This scaffolds out the + various files and folders a fresh project needs. +--- + New `fresh` projects can be created with the `fresh` CLI tool. It will scaffold out a new project with some example files to get you started. @@ -33,7 +39,7 @@ dependencies: be referenced by modules that might be shipped to the client. By default this just re-exports the `fresh` server libraries. -Finally, two folders are created that contain your routes and islands +Two important folders are also created that contain your routes and islands respectively: - **`routes/`**: This folder contains all of the routes in your project. The @@ -44,3 +50,8 @@ respectively: project. The name of each file corresponds to the name of the island defined in that file. Code inside of this folder can be run from both client and server. You'll learn more about islands later in this chapter. + +Finally a **`static/`** folder is created that contains static files that are +automatically served "as is". [Learn more about static files][static-files]. + +[static-files]: ../concepts/static-files diff --git a/docs/getting-started/create-a-route.md b/docs/getting-started/create-a-route.md index 790038e4..e8b8f187 100644 --- a/docs/getting-started/create-a-route.md +++ b/docs/getting-started/create-a-route.md @@ -1,3 +1,9 @@ +--- +description: | + Create a new route to a fresh project by creating a new file in the `routes/` + folder. +--- + After getting the project running locally, the next step is to add a new route to the project. Routes encapsulate the logic for handling requests to a particular path in your project. They can be used to handle API requests, or diff --git a/docs/getting-started/custom-handlers.md b/docs/getting-started/custom-handlers.md index 057ce531..2d6bb1cf 100644 --- a/docs/getting-started/custom-handlers.md +++ b/docs/getting-started/custom-handlers.md @@ -1,3 +1,9 @@ +--- +description: | + Add custom handlers to a route to customize HTTP headers, implement API + routes, do data fetching for a rendered page, or handle form submissions. +--- + Routes actually consist of two parts: handlers, and the page component. Up to now, only the page component has been discussed in this chapter. diff --git a/docs/getting-started/deploy-to-production.md b/docs/getting-started/deploy-to-production.md index e2f51457..25d39654 100644 --- a/docs/getting-started/deploy-to-production.md +++ b/docs/getting-started/deploy-to-production.md @@ -1,3 +1,9 @@ +--- +description: | + Deploy a fresh application to Deno Deploy in seconds, making it available on + the edge globally - resulting in fantastic user latency worldwide. +--- + As a final step in the getting started guide, we'll deploy the demo site to the public internet using [Deno Deploy][deno-deploy]. Deno Deploy is a globally distributed edge runtime built by the Deno company that allows developers to diff --git a/docs/getting-started/dynamic-routes.md b/docs/getting-started/dynamic-routes.md index 7e9a9b91..ad8153d7 100644 --- a/docs/getting-started/dynamic-routes.md +++ b/docs/getting-started/dynamic-routes.md @@ -1,3 +1,9 @@ +--- +description: | + Create a dynamic route in fresh by adding a dynamic segment to the route name + in the routes' file name on disk: `/greet/[name].tsx`. +--- + The `/about` route created on the last page is pretty static. It does not matter what query or path parameters are passed to the route, it will always render the same page. Let's create a `/greet/:name` that will render a page with a greeting diff --git a/docs/getting-started/fetching-data.md b/docs/getting-started/fetching-data.md index 7b5c5ee6..aaf0a7a1 100644 --- a/docs/getting-started/fetching-data.md +++ b/docs/getting-started/fetching-data.md @@ -1,3 +1,9 @@ +--- +description: | + Fetch data for routes dynamically by creating a custom handler and passing + data to the render function. +--- + All of the pages in the demo project so far have not used any dynamic data during rendering. In real projects, this is often different. In many cases you may need to read a file from disk (e.g. markdown for a blog post), or fetch some diff --git a/docs/getting-started/form-submissions.md b/docs/getting-started/form-submissions.md index 4e64df31..f78c8476 100644 --- a/docs/getting-started/form-submissions.md +++ b/docs/getting-started/form-submissions.md @@ -1,3 +1,9 @@ +--- +description: | + Robustly handle user inputs using HTML `
` elements client side, and form + submission handlers server side. +--- + Forms are a common mechanism for letting users interact with applications. In the last few years it has become more and more common for web applications to move form submission entirely to the client. This is can have useful properties diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md index 5d9c7223..3add2d35 100644 --- a/docs/getting-started/index.md +++ b/docs/getting-started/index.md @@ -1,3 +1,10 @@ +--- +description: | + In this chapter of the `fresh` documentation, you'll be introduced to the + framework. Create a new project, run it locally, edit and create pages, fetch + data, handle user interactions, and deploy it. +--- + In this chapter of the `fresh` documentation, you'll be introduced to the framework. You'll learn how to create a new project, run it locally, edit and create pages, fetch data, handle user interactions, and how to then deploy the diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 158721aa..0c3c91a2 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -1,3 +1,9 @@ +--- +description: | + Install the `fresh` CLI tool to scaffold new projects and generate the fresh + manifest. The CLI tool can be installed with `deno install`. +--- + `fresh` comes with a CLI tool, conveniently also called `fresh`. It is used to scaffold new projects and generate the fresh manifest (more on that later). This tool is only needed to create a new project, or to re-generate the fresh diff --git a/docs/getting-started/running-locally.md b/docs/getting-started/running-locally.md index 0ab72200..0cd24268 100644 --- a/docs/getting-started/running-locally.md +++ b/docs/getting-started/running-locally.md @@ -1,3 +1,9 @@ +--- +description: | + To start a fresh project, just run `deno task start`. This will start the + project with default permission flags, in watch mode. +--- + The next step after scaffolding out a new project, is to actually start it. To do this you can just `deno task start`. diff --git a/docs/introduction/index.md b/docs/introduction/index.md index 498630f8..b591a433 100644 --- a/docs/introduction/index.md +++ b/docs/introduction/index.md @@ -1,3 +1,10 @@ +--- +description: | + `fresh` is a full stack modern web framework for JavaScript and TypeScript + developers, designed to make it trivial to create high-quality, performant, + and personalized web applications. +--- + `fresh` is a full stack modern web framework for JavaScript and TypeScript developers, designed to make it trivial to create high-quality, performant, and personalized web applications. You can use it to create your home page, a blog, diff --git a/www/client_deps.ts b/www/client_deps.ts index 0630a7e6..f55b3620 100644 --- a/www/client_deps.ts +++ b/www/client_deps.ts @@ -11,6 +11,7 @@ export const theme = { green: colors.green, white: colors.white, yellow: colors.yellow, + transparent: "transparent", }, }; if (IS_BROWSER) { diff --git a/www/routes/docs/[...slug].tsx b/www/routes/docs/[...slug].tsx index 28586a13..35bc2b7c 100644 --- a/www/routes/docs/[...slug].tsx +++ b/www/routes/docs/[...slug].tsx @@ -140,7 +140,7 @@ function Title() { fill="none" alt="Fresh logo" xmlns="http://www.w3.org/2000/svg" - class={tw`h-5 inline-block py-1px`} + class={tw`h-5 inline-block py-[1px]`} >