Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 34c05cb

Browse files
author
Je
committed
chore: update examples
1 parent 7faca67 commit 34c05cb

File tree

5 files changed

+69
-8
lines changed

5 files changed

+69
-8
lines changed

examples/hello-world/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { ComponentType } from 'https://esm.sh/react'
22
import { Head } from 'https://deno.land/x/aleph/mod.ts'
33

4-
export default function App({ Page }: { Page: ComponentType<any> }) {
4+
export default function App({ Page }: { Page: ComponentType }) {
55
return (
66
<>
77
<Head>

examples/markdown-blog/pages/blog.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
import React, { ComponentType } from 'https://esm.sh/react'
21
import { Head } from 'https://deno.land/x/aleph/mod.ts'
2+
import React, { ComponentType } from 'https://esm.sh/react'
3+
4+
interface Metadata {
5+
title: string
6+
author: string
7+
date: string
8+
}
39

4-
export default function Blog({ Page, pageProps }: { Page: ComponentType<any>, pageProps: { title: string } }) {
10+
export default function Blog({ Page }: { Page: ComponentType & { meta: Metadata } }) {
511
return (
612
<>
713
<Head>
8-
<title>{pageProps.title}</title>
14+
<title>{Page.meta.title}</title>
915
</Head>
16+
<h1>{Page.meta.title}</h1>
17+
<p style={{ color: 'gray', border: '1px solid #ddd', padding: 12, borderRadius: 6 }}>
18+
<small>
19+
<em>{Page.meta.author}, {Page.meta.date}</em>
20+
</small>
21+
</p>
1022
<Page />
1123
</>
1224
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Hello World
2+
title: Hello World!
33
author: postUI Lab.
44
date: 2020-10-01
55
---
6-
# Hello World
6+
77
Welcome to use **Aleph.js**!
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Aleph.js
3+
author: postUI Lab.
4+
date: 2020-10-01
5+
---
6+
7+
The React Framework in [Deno](https://deno.land), inspired by [next.js](https://nextjs.org) and [snowpack](https://www.snowpack.dev).
8+
9+
## Features
10+
- Zero Config
11+
- Typescript in Deno
12+
- ES Module Ready
13+
- HMR with Fast Refresh
14+
- File-system Routing
15+
- Markdown Page
16+
- Built-in CSS(Less) Support
17+
- SSR/SSG
18+
19+
## Usage
20+
```bash
21+
# install aleph.js command
22+
deno install --allow-read --allow-write --allow-net -f -n aleph https://deno.land/x/aleph/cli.ts
23+
24+
# initiate a new app
25+
$ aleph init hello
26+
$ cd hello
27+
28+
# start app in development mode
29+
$ aleph
30+
31+
# start app in production mode
32+
$ aleph start
33+
34+
# build app
35+
$ aleph build
36+
37+
# help message
38+
$ aleph -h
39+
```
40+
41+
## Documentation
42+
Please visit https://alephjs.org/docs to view the documentation.
43+
44+
## Contributing
45+
Please read the [contributing.md](CONTRIBUTING.md).

examples/markdown-blog/pages/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
import { Import, Link } from 'https://deno.land/x/aleph/mod.ts'
1+
import { Head, Link } from 'https://deno.land/x/aleph/mod.ts'
22
import React from 'https://esm.sh/react'
33

44
export default function Home() {
55
return (
66
<div className="wrapper">
7+
<Head>
8+
<title>My Blog.</title>
9+
</Head>
710
<h1>My Blog.</h1>
811
<ul>
9-
<li><Link to="/blog/hello-world">Hello World</Link></li>
12+
<li><Link to="/blog">Hello World</Link></li>
13+
<li><Link to="/blog/readme">Aleph.js</Link></li>
1014
</ul>
1115
</div>
1216
)

0 commit comments

Comments
 (0)