format
This commit is contained in:
parent
1f8c6bde50
commit
4875c08757
51
README.md
51
README.md
|
|
@ -55,22 +55,23 @@ The `req` JSX prop will be given the `Hono` request:
|
|||
|
||||
If `_layout.tsx` exists, your pages will automatically be wrapped in it:
|
||||
|
||||
export default ({ children, title }: any) =>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{title ?? 'hype'}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
```tsx
|
||||
export default ({ children, title }: any) => (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{title ?? "hype"}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<link href="/css/main.css" rel="stylesheet" />
|
||||
<script src="/js/main.ts" type="module"></script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
{children}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
<link href="/css/main.css" rel="stylesheet" />
|
||||
<script src="/js/main.ts" type="module"></script>
|
||||
</head>
|
||||
<body>
|
||||
<main>{children}</main>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
```
|
||||
|
||||
(Files starting with `_` don't get served directly.)
|
||||
|
||||
|
|
@ -78,18 +79,24 @@ If `_layout.tsx` exists, your pages will automatically be wrapped in it:
|
|||
|
||||
CSS can be accessed via `/css/main.css`:
|
||||
|
||||
<link href="/css/reset.css" rel="stylesheet" />
|
||||
```html
|
||||
<link href="/css/reset.css" rel="stylesheet" />
|
||||
```
|
||||
|
||||
### js
|
||||
|
||||
JS can be accessed (and transpiled) via `/js/main.ts` or `/shared/utils.ts`:
|
||||
|
||||
<script src="/js/main.ts" type="module"></script>
|
||||
```html
|
||||
<script src="/js/main.ts" type="module"></script>
|
||||
```
|
||||
|
||||
import your modules relatively, for example in `main.ts`:
|
||||
|
||||
import { initAbout } from './about'
|
||||
import utils from './shared/utils'
|
||||
```typescript
|
||||
import { initAbout } from "./about"
|
||||
import utils from "./shared/utils"
|
||||
```
|
||||
|
||||
### pub
|
||||
|
||||
|
|
@ -152,5 +159,7 @@ export default app.defaults
|
|||
|
||||
4. Enter dev mode
|
||||
|
||||
bun install
|
||||
bun test
|
||||
```sh
|
||||
bun install
|
||||
bun test
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user