mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
rewrite
This commit is contained in:
18
src/pages/skills/[id].astro
Normal file
18
src/pages/skills/[id].astro
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { render } from "astro:content";
|
||||
import { data } from "~/data/data";
|
||||
|
||||
export const getStaticPaths = (async () => {
|
||||
const skills = await data.skills.getAll();
|
||||
return skills.map((skill) => ({
|
||||
params: { id: skill.id }
|
||||
}));
|
||||
}) satisfies GetStaticPaths;
|
||||
|
||||
const skill= await data.skills.get(Astro.params.id)
|
||||
const { Content } = await render(skill);
|
||||
---
|
||||
|
||||
<h1>Hello {skill.data.name}</h1>
|
||||
<Content />
|
||||
Reference in New Issue
Block a user