new_akademy_landing/src/pages/blogs/index.astro

20 lines
855 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
import Layout from "../../layouts/Layout.astro";
import AllBlogs from "../../components/Blogs/index";
const BLOG_API_URL = "https://curriculum-app-api.beanstalkedu.com/items/blog";
let blogs = [];
try {
const response = await fetch(`${BLOG_API_URL}?filter[status][_eq]=published&filter[property][_eq]=aKadmy`);
const data = await response.json();
blogs = data.data || [];
console.log("Fetched blogs:", blogs[0].slug);
} catch (error) {
console.error("Error fetching blogs:", error);
blogs = [];
}
---
<Layout title="aKadmy Blogs | Insights, Tips, and Trends for Early Childhood" description={'Stay updated with the latest trends, insights, and tips on early childhood education. Explore aKadmys blog for valuable resources and expert advice.'} canonicalUrl={'https://akadmyapp.com/blogs'}>
<AllBlogs client:only="react" />
</Layout>