feat: use import.meta.glob instead of Astro.glob

This commit is contained in:
Ayo Ayco 2025-04-13 02:15:16 +02:00
parent 3c5d764711
commit 89a0505526

View file

@ -2,8 +2,12 @@
import Layout from '../../../layouts/Layout.astro'
import Footer from '../../../components/Footer.astro'
import Posts from '../../../components/Posts.astro'
import type { AstroInstance } from 'astro'
const posts = await Astro.glob('./posts/*.astro')
// const posts = await Astro.glob('./posts/*.astro')
const posts: AstroInstance[] = Object.values<AstroInstance>(
import.meta.glob('./posts/*.astro', { eager: true })
)
const title = 'Previously...'
---
@ -17,12 +21,6 @@ const title = 'Previously...'
</Layout>
<style>
main {
margin: auto;
padding: 1em;
max-width: var(--content-width);
}
.text-gradient {
font-weight: 900;
background-image: var(--ayo-gradient);