chore: init

This commit is contained in:
2025-02-05 18:05:56 +06:00
commit 5f99ba28c4
19 changed files with 4546 additions and 0 deletions

32
src/pages/index.astro Normal file
View File

@@ -0,0 +1,32 @@
---
import fetchApi from "../lib/strapi";
import type { ArticleData } from "../interfaces/article";
const articles = await fetchApi<ArticleData[]>({
endpoint: "articles?populate=image",
wrappedByKey: "data",
});
console.log('Articles response:', articles);
---
<!doctype html>
<html lang="en">
<head>
<title>Blog</title>
</head>
<body>
<main>
<ul>
{
articles.map((article) => (
<li>
<a href={`/blog/${article.slug}/`}>{article.title}</a>
</li>
))
}
</ul>
</main>
</body>
</html>