From 89a050552642643e5d3bd3c88b95652f5e884ad2 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Sun, 13 Apr 2025 02:15:16 +0200 Subject: [PATCH] feat: use import.meta.glob instead of Astro.glob --- src/pages/now/and-then/index.astro | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pages/now/and-then/index.astro b/src/pages/now/and-then/index.astro index a0b8c68..b4ad12e 100644 --- a/src/pages/now/and-then/index.astro +++ b/src/pages/now/and-then/index.astro @@ -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( + import.meta.glob('./posts/*.astro', { eager: true }) +) const title = 'Previously...' --- @@ -17,12 +21,6 @@ const title = 'Previously...'