Skip to content

Commit 470cfc6

Browse files
committed
docs: update Astro documentation with examples and additional resources
1 parent 0f826f7 commit 470cfc6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

docs/docs/languages/astro.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Astro
2+
13
Astro is a modern static site builder focused on delivering fast, content-driven websites. It uses a “zero JavaScript by default” approach and supports multiple frameworks like React, Vue, and Svelte through an islands architecture.
24

35
## Usage
@@ -29,7 +31,6 @@ In this mode, values can be provided dynamically during request handling.
2931
**Example:** Create a server-side API endpoint:
3032

3133
```js
32-
// src/pages/api/hello.js
3334
export async function GET() {
3435
return new Response(JSON.stringify({ name: 'LiveCodes' }), {
3536
headers: { 'Content-Type': 'application/json' },
@@ -41,7 +42,7 @@ Then fetch and render it dynamically in Astro:
4142

4243
```astro
4344
---
44-
const res = await fetch('/api/hello');
45+
const res = await fetch('https://jsonplaceholder.typicode.com/users/1');
4546
const data = await res.json();
4647
---
4748
<h1>Hello {data.name}!</h1>
@@ -57,6 +58,8 @@ const data = await res.json();
5758
* **Compiler:** Astro Compiler
5859
* **Version:** Latest (v4.x and above)
5960

61+
⚠️ LiveCodes currently uses Astro v0.9.2, so some latest features may not be available.
62+
6063
---
6164

6265
## Code Formatting
@@ -105,6 +108,7 @@ const data = await res.json();
105108
<p>{data.title}</p>
106109
```
107110

111+
108112
---
109113

110114
## Official Resources
@@ -114,5 +118,6 @@ const data = await res.json();
114118
* 🧪 [Astro Playground](https://stackblitz.com/github/withastro/astro/tree/latest/examples/hello-world)
115119
* 📰 [Astro Blog](https://astro.build/blog)
116120
* 💬 [Astro Discord Community](https://astro.build/chat)
121+
* 🌐 [Astro Starter Template](https://livecodes.io/?template=astro)
117122

118123

0 commit comments

Comments
 (0)