add blog
This commit is contained in:
24
superpage/src/pages/blog/index.astro
Normal file
24
superpage/src/pages/blog/index.astro
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
import Layout from "~/layouts/Layout.astro";
|
||||||
|
import Container from "~/components/Container.astro";
|
||||||
|
|
||||||
|
let res = await fetch("https://betaeducacao.com.br/wp-json/wp/v2/posts");
|
||||||
|
let posts = await res.json();
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<Container>
|
||||||
|
{
|
||||||
|
posts.map((post) => (
|
||||||
|
<article>
|
||||||
|
<h2>
|
||||||
|
<a
|
||||||
|
href={`/blog/${post.slug}`}
|
||||||
|
set:html={post.title.rendered}
|
||||||
|
/>
|
||||||
|
</h2>
|
||||||
|
</article>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</Container>
|
||||||
|
</Layout>
|
||||||
Reference in New Issue
Block a user