Skip to content

Commit 2a25b09

Browse files
committed
Añadiendo contenido a la pagina dinamica
1 parent 484ed13 commit 2a25b09

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/pages/projects/[slug].astro

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
import BaseLayout from "@layouts/BaseLayout.astro";
3+
import projectsData from "@data/projects.json";
4+
5+
export function getStaticPaths() {
6+
return projectsData.projects.map((project) => ({
7+
params: {
8+
slug: project.name.toLowerCase().replace(/\s+/g, "-"),
9+
},
10+
props: { project },
11+
}));
12+
}
13+
14+
const { project } = Astro.props;
15+
---
16+
17+
<BaseLayout title={`${project.name} — Marcos Almorox`}>
18+
<main>
19+
<h1>{project.name}</h1>
20+
<p>{project.description}</p>
21+
<a href={project.link} target="_blank">Ver en GitHub</a>
22+
</main>
23+
</BaseLayout>

0 commit comments

Comments
 (0)