mirror of
https://codeberg.org/JasterV/jaster.xyz.git
synced 2026-04-26 18:10:01 +00:00
chore: update deprecated Astro.glob
This commit is contained in:
parent
f5eae26ea4
commit
304bc57422
3 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import PostCards from "../components/PostCards.astro";
|
||||
import Layout from "../layouts/BaseLayout.astro";
|
||||
|
||||
const allPosts = await Astro.glob("../pages/posts/*.md");
|
||||
const allPosts = Object.values(import.meta.glob('../pages/posts/*.md', { eager: true }));
|
||||
|
||||
const pageTitle = "My Blog";
|
||||
---
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import PostCards from "../../components/PostCards.astro";
|
|||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const allPosts = await Astro.glob("../posts/*.md");
|
||||
const allPosts = Object.values(import.meta.glob('../posts/*.md', { eager: true }));
|
||||
|
||||
const uniqueTags = [
|
||||
...new Set(allPosts.map((post) => post.frontmatter.tags).flat()),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||
import Tags from "../../components/Tags.astro";
|
||||
|
||||
const allPosts = await Astro.glob("../posts/*.md");
|
||||
const allPosts = Object.values(import.meta.glob('../posts/*.md', { eager: true }));
|
||||
|
||||
const tags = [...new Set(allPosts.map((post) => post.frontmatter.tags).flat())];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue