mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-11-23 12:06:07 -05:00
trim some unnecessary dependencies
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { cache } from "react";
|
||||
import path from "path";
|
||||
import fs from "fs/promises";
|
||||
import glob from "fast-glob";
|
||||
import { unified } from "unified";
|
||||
import { read } from "to-vfile";
|
||||
import { remarkHtml, remarkParse, remarkSmartypants, remarkFrontmatter } from "./remark-rehype-plugins";
|
||||
import { decode } from "html-entities";
|
||||
import { BASE_URL, POSTS_DIR } from "../config/constants";
|
||||
@@ -130,7 +130,7 @@ export const getContent = cache(async (slug: string): Promise<string | undefined
|
||||
],
|
||||
},
|
||||
})
|
||||
.process(await read(path.resolve(process.cwd(), `${POSTS_DIR}/${slug}/index.mdx`)));
|
||||
.process(await fs.readFile(path.resolve(process.cwd(), `${POSTS_DIR}/${slug}/index.mdx`)));
|
||||
|
||||
// convert the parsed content to a string with "safe" HTML
|
||||
return content.toString().replaceAll("<p></p>", "").trim();
|
||||
|
||||
Reference in New Issue
Block a user