Skip to content

Commit

Permalink
[][xs]: Add the ability to pass a preProcess function (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsalem401 authored Jan 30, 2024
1 parent d5acfe2 commit 9b97d85
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import siteConfig from "@/config/siteConfig";
* @returns: { mdxSource: mdxSource, frontMatter: ...}
*/
const parse = async function (source, format, scope) {
if (siteConfig.preProcess) {
source = siteConfig.preProcess(source);
}
const { content, data } = matter(source);
const permalinks = await getPermalinks(siteConfig.content);

Expand Down

0 comments on commit 9b97d85

Please sign in to comment.