Skip to content

Commit c349fb5

Browse files
committed
docs: fix misleading main.tsx filenames
1 parent f82bd7e commit c349fb5

File tree

8 files changed

+17
-13
lines changed

8 files changed

+17
-13
lines changed

docs/latest/advanced/app-wrapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ structure of the HTML document, typically up until the `<body>`-tag. It is only
88
rendered on the server and never on the client. The passed `Component` value
99
represents the children of this component.
1010

11-
```tsx main.tsx
11+
```tsx routes/_app.tsx
1212
function AppWrapper({ Component }) {
1313
return (
1414
<html lang="en">

docs/latest/advanced/error-handling.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Fresh supports two kind of error pages:
2121
To add an error page use [`app.onError()`](/docs/concepts/app#onerror).
2222

2323
```ts main.ts
24+
import { App } from "fresh";
25+
2426
const app = new App()
2527
.onError("*", (ctx) => {
2628
console.log(`Error: ${ctx.error}`);
@@ -36,7 +38,7 @@ will be invoked.
3638

3739
You can also nest error pages:
3840

39-
```ts main.ts
41+
```ts
4042
const app = new App()
4143
// Top level error page
4244
.onError("*", (ctx) => {
@@ -56,7 +58,7 @@ Not found errors are often treated differently than generic errors. You can both
5658
treat them with the `.onError()` way, but by adding a specific `.notFound()`
5759
handler, Fresh ensures that every 404 error will invoke this callback.
5860

59-
```ts main.ts
61+
```ts
6062
const app = new App()
6163
// Top level error page
6264
.notFound((ctx) => {
@@ -90,7 +92,7 @@ async function authMiddleware(ctx) {
9092

9193
You can check the status code of the thrown `HttpError` in your error handler:
9294

93-
```ts main.ts
95+
```ts
9496
app.onError((ctx) => {
9597
if (ctx.error instanceof HttpError) {
9698
const status = ctx.error.status;

docs/latest/advanced/layouts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ HTML structure and only the content changes, a layout is a neat way to abstract
88
this. Layouts only ever render on the server. The passed `Component` value
99
represents the children of this component.
1010

11-
```tsx main.tsx
11+
```tsx
1212
function PageLayout({ Component }) {
1313
return (
1414
<div>
@@ -36,12 +36,12 @@ If you browse to the `/` route, Fresh will render the following HTML
3636

3737
Add a layout and ignore all previously inherited ones.
3838

39-
```ts main.ts
39+
```ts
4040
app.layout("/foo/bar", MyComponent, { skipInheritedLayouts: true });
4141
```
4242

4343
Ignore the app wrapper component:
4444

45-
```ts main.ts
45+
```ts
4646
app.layout("/foo/bar", MyComponent, { skipAppWrapper: true });
4747
```

docs/latest/concepts/app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The `App` class is the heart of Fresh and routes incoming requests to the
77
correct middlewares. This is where routes, middlewares, layouts and more are
88
defined.
99

10-
```tsx main.ts
10+
```ts
1111
const app = new App()
1212
.use(staticFiles())
1313
.get("/", () => new Response("hello"))
@@ -20,7 +20,7 @@ app.listen();
2020
All items are applied from top to bottom. This means that when you defined a
2121
middleware _after_ a `.get()` handler, it won't be included.
2222

23-
```tsx main.tsx
23+
```ts
2424
const app = new App()
2525
.use((ctx) => {
2626
// Will be called for all middlewares

docs/latest/concepts/islands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function MyIsland() {
2828
An island can be used anywhere like a regular Preact component. Fresh will take
2929
care of making it interactive on the client.
3030

31-
```tsx main.tsx
31+
```tsx main.ts
3232
import { App, staticFiles } from "fresh";
3333
import MyIsland from "./islands/my-island.tsx";
3434

docs/latest/concepts/routing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Routing defines which middlewares and routes should respond to a particular
77
request.
88

99
```ts main.ts
10+
import { App } from "fresh";
11+
1012
const app = new App()
1113
.get("/", () => new Response("hello")) // Responds to: GET /
1214
.get("/other", () => new Response("other")) // Responds to: GET /other

docs/latest/concepts/static-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ const app = new App()
2121
By default, Fresh adds caching headers for the `src` and `srcset` attributes on
2222
`<img>` and `<source>` tags.
2323

24-
```tsx main.tsx
24+
```ts
2525
// Caching headers will be automatically added
2626
app.get("/user", (ctx) => ctx.render(<img src="/user.png" />));
2727
```
2828

2929
You can always opt out of this behaviour per tag, by adding the
3030
`data-fresh-disable-lock` attribute.
3131

32-
```tsx main.tsx
32+
```ts
3333
// Opt-out of automatic caching headers
3434
app.get(
3535
"/user",

docs/latest/introduction/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Fresh is a small, fast and extensible full stack web framework built on Web
99
Standards. It's designed for building high-quality, performant, and personalized
1010
web applications.
1111

12-
```tsx main.tsx
12+
```tsx main.ts
1313
import { App } from "fresh";
1414

1515
const app = new App()

0 commit comments

Comments
 (0)