diff --git a/app/layout.tsx b/app/layout.tsx index 5c22330..9fa111b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,9 +1,7 @@ import Nav from "components/Nav" import "styles/tailwind.css" -import { getContentDirs } from "utils/contentDirs" export default function RootLayout({ children }: { children: React.ReactNode }) { - getContentDirs() return ( diff --git a/hooks/useMdxContent.ts b/hooks/useMdxContent.ts index 33e715c..5a1dd70 100644 --- a/hooks/useMdxContent.ts +++ b/hooks/useMdxContent.ts @@ -1,9 +1,9 @@ -import { compile } from '@mdx-js/mdx' import { client } from 'tina/__generated__/client' import fs from 'fs' import path, { parse } from 'path' import matter from 'gray-matter'; import { parseMDX } from "@tinacms/mdx"; +import { getContentDirs } from 'utils/contentDirs'; const DEV = process.env.NODE_ENV === 'development' @@ -22,6 +22,7 @@ export const getMdxContent = async (contentType: keyof typeof cli const r = await client.queries[contentType]({ relativePath }) return r } else { + getContentDirs() const filepath = path.join(process.cwd(), 'content', contentType, relativePath) const mdxContent = fs.readFileSync(filepath, 'utf-8') const frontMatter = matter(mdxContent)