docs: add descriptions to all pages (#195)

This commit is contained in:
Luca Casonato
2022-05-17 02:19:32 +02:00
committed by GitHub
parent 637a0463b6
commit 2a2b948a58
15 changed files with 88 additions and 2 deletions
@@ -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,
+12 -1
View File
@@ -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
+6
View File
@@ -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
+6
View File
@@ -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.
@@ -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
+6
View File
@@ -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
+6
View File
@@ -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
+6
View File
@@ -1,3 +1,9 @@
---
description: |
Robustly handle user inputs using HTML `<form>` 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
+7
View File
@@ -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
+6
View File
@@ -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
+6
View File
@@ -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`.