From bc4a0ad8dd3382a2a320cdfacc963aa8208ccff7 Mon Sep 17 00:00:00 2001 From: prototypa Date: Wed, 31 Aug 2022 20:12:49 -0400 Subject: [PATCH] Remove .mdx (not compatible) from import.meta.glob --- src/utils/fetchPosts.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/fetchPosts.js b/src/utils/fetchPosts.js index 979612d..526109e 100644 --- a/src/utils/fetchPosts.js +++ b/src/utils/fetchPosts.js @@ -1,7 +1,7 @@ import { getNormalizedPost } from "~/utils/getNormalizedPost"; const load = async function () { - const posts = import.meta.glob("~/data/posts/**/*.{md,mdx}", { + const posts = import.meta.glob("~/data/posts/**/*.md", { eager: true, }); @@ -29,9 +29,9 @@ export const findPostsByIds = async (ids) => { const posts = await fetchPosts(); - return ids.reduce(function (r, a) { - posts.some(function (el) { - return a === el.slug && r.push(el); + return ids.reduce(function (r, id) { + posts.some(function (post) { + return id === post.ID && r.push(post); }); return r; }, []);