Skip to content

Commit fbc0c86

Browse files
committed
updated astro
1 parent 594184a commit fbc0c86

File tree

470 files changed

+6013
-7792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

470 files changed

+6013
-7792
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Creando el proyecto
2+
3+
Para crear el proyecto Astro, arrancamos desde cero.
4+
5+
Lo primero utlizamos el CLI de Astro para crear la estructura del proyecto:
6+
7+
```bash
8+
npm create astro@latest
9+
```
10+
11+
Le damos como nombre al proyecto _miblog_
12+
13+
Elegimos la opción _A basic, minimal starter_
14+
15+
Elegimos en `Install Dependencies` Yes
16+
17+
Y En Initalize Git Repository, como quieras, en este caso Yes
18+
19+
Ahora entramos en la carpeta del proyecto (lo idea es abrir carpeta nueva desde VSCode)
20+
21+
Arrancamos el proyecto y vemos que funciona
22+
23+
```bash
24+
npm run dev
25+
```
26+
27+
Abrimos en el navegador y navegamos a la ruta `locahost:4321` y todo funciona correctamente.
28+
29+
> Para mejor experiencia mira que tengamos el plugin de Astro en VSCode instalado.
30+
31+
Antes de seguir, para que sea más fácil formatear el código, vamos a instalar prettier y la extensión para astro
32+
33+
```bash
34+
npm install --save-dev prettier
35+
```
36+
37+
```bash
38+
npm install --save-dev prettier-plugin-astro
39+
```
40+
41+
Y añadimos configuración para prettier en el archivo `.prettierrc`:
42+
43+
_./.prettierrc_
44+
45+
```json
46+
{
47+
"plugins": ["prettier-plugin-astro"],
48+
"overrides": [
49+
{
50+
"files": "*.astro",
51+
"options": {
52+
"parser": "astro"
53+
}
54+
}
55+
]
56+
}
57+
```
58+
59+
# Limpiando
60+
61+
Y ya que estamos limpiamos fichero que no necesitamos:
62+
63+
`./src/assets/astro.svg`
64+
`./src/assets/background.svg`
65+
66+
`./components/Welcome.astro`
67+
68+
y en `./src/pages/index.astro` actualizamos:
69+
70+
```diff
71+
---
72+
- import Welcome from '../components/Welcome.astro';
73+
import Layout from '../layouts/Layout.astro';
74+
75+
// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build
76+
// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh.
77+
---
78+
79+
<Layout>
80+
- <Welcome />
81+
+ <h1>Hello Blog !</h1>
82+
</Layout>
83+
84+
```
85+
86+
87+
Ya estamos listos para empezar a crear nuestro blog.

04-frameworks/15-astro/02-creando-proyecto/.gitignore renamed to 04-frameworks/15-astro/01-creando-proyecto/miblog/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# build output
22
dist/
3+
34
# generated types
45
.astro/
56

@@ -12,7 +13,6 @@ yarn-debug.log*
1213
yarn-error.log*
1314
pnpm-debug.log*
1415

15-
1616
# environment variables
1717
.env
1818
.env.production

04-frameworks/15-astro/07-contenido-dinamico/.prettierrc renamed to 04-frameworks/15-astro/01-creando-proyecto/miblog/.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
}
99
}
1010
]
11-
}
11+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Astro Starter Kit: Basics
2+
3+
```sh
4+
npm create astro@latest -- --template basics
5+
```
6+
7+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
8+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
9+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
10+
11+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
12+
13+
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)
14+
15+
## 🚀 Project Structure
16+
17+
Inside of your Astro project, you'll see the following folders and files:
18+
19+
```text
20+
/
21+
├── public/
22+
│ └── favicon.svg
23+
├── src/
24+
│ ├── layouts/
25+
│ │ └── Layout.astro
26+
│ └── pages/
27+
│ └── index.astro
28+
└── package.json
29+
```
30+
31+
To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).
32+
33+
## 🧞 Commands
34+
35+
All commands are run from the root of the project, from a terminal:
36+
37+
| Command | Action |
38+
| :------------------------ | :----------------------------------------------- |
39+
| `npm install` | Installs dependencies |
40+
| `npm run dev` | Starts local dev server at `localhost:4321` |
41+
| `npm run build` | Build your production site to `./dist/` |
42+
| `npm run preview` | Preview your build locally, before deploying |
43+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
44+
| `npm run astro -- --help` | Get help using the Astro CLI |
45+
46+
## 👀 Want to learn more?
47+
48+
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
2-
"name": "ejemplo",
2+
"name": "miblog",
33
"type": "module",
44
"version": "0.0.1",
55
"scripts": {
66
"dev": "astro dev",
7-
"start": "astro dev",
8-
"build": "astro check && astro build",
7+
"build": "astro build",
98
"preview": "astro preview",
109
"astro": "astro"
1110
},
1211
"dependencies": {
13-
"@astrojs/check": "^0.9.4",
14-
"astro": "^4.16.13",
15-
"typescript": "^5.6.3"
12+
"astro": "^5.5.2"
1613
},
1714
"devDependencies": {
15+
"prettier": "^3.5.3",
1816
"prettier-plugin-astro": "^0.14.1"
1917
}
2018
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
---
2-
3-
---
4-
1+
<!doctype html>
52
<html lang="en">
63
<head>
7-
<meta charset="utf-8" />
8-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
4+
<meta charset="UTF-8" />
95
<meta name="viewport" content="width=device-width" />
6+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
107
<meta name="generator" content={Astro.generator} />
11-
<title>Mi Blog de Ejemplo</title>
8+
<title>Astro Basics</title>
129
</head>
1310
<body>
14-
<h1>Mi blog de Ejemplo</h1>
11+
<slot />
1512
</body>
1613
</html>
14+
15+
<style>
16+
html,
17+
body {
18+
margin: 0;
19+
width: 100%;
20+
height: 100%;
21+
}
22+
</style>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
import Layout from "../layouts/Layout.astro";
3+
4+
// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build
5+
// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh.
6+
---
7+
8+
<Layout>
9+
<h1>Hello Blog !</h1>
10+
</Layout>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "astro/tsconfigs/strict",
3+
"include": [".astro/types.d.ts", "**/*"],
4+
"exclude": ["dist"]
5+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

04-frameworks/15-astro/01-entorno/readme.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

04-frameworks/15-astro/06-markdown/.gitignore renamed to 04-frameworks/15-astro/02-creando-estructura/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# build output
22
dist/
3+
34
# generated types
45
.astro/
56

@@ -12,7 +13,6 @@ yarn-debug.log*
1213
yarn-error.log*
1314
pnpm-debug.log*
1415

15-
1616
# environment variables
1717
.env
1818
.env.production

04-frameworks/15-astro/09-estilado-global/.prettierrc renamed to 04-frameworks/15-astro/02-creando-estructura/.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
}
99
}
1010
]
11-
}
11+
}

0 commit comments

Comments
 (0)