Skip to content

Commit

Permalink
Remove .mdx (not compatible) from import.meta.glob
Browse files Browse the repository at this point in the history
  • Loading branch information
prototypa committed Sep 1, 2022
1 parent f603727 commit bc4a0ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/fetchPosts.js
Original file line number Diff line number Diff line change
@@ -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,
});

Expand Down Expand Up @@ -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;
}, []);
Expand Down

0 comments on commit bc4a0ad

Please sign in to comment.