Skip to content

Commit

Permalink
feat(MDX): add basic MDX support
Browse files Browse the repository at this point in the history
issue #614
  • Loading branch information
sabertazimi committed Apr 25, 2022
1 parent b229f02 commit a9eaef3
Show file tree
Hide file tree
Showing 17 changed files with 1,472 additions and 721 deletions.
4 changes: 3 additions & 1 deletion __mocks__/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ const basePosts = Array.from(Array(5).keys()).map(index => ({
timeToRead: index + 1,
prevPost: null,
nextPost: null,
source: `## ${index + 1} Basic Notes`,
source: {
compiledSource: `## ${index + 1} Basic Notes`,
},
}));

const posts = basePosts.map((post, index) => ({
Expand Down
6 changes: 3 additions & 3 deletions components/Article/Article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Article = ({
prevPost,
nextPost,
toc,
html,
source,
} = post;

const postMeta = {
Expand All @@ -52,8 +52,8 @@ const Article = ({
<div>
<ArticleHeader post={postMeta} />
<Container className="max-w-screen-lg px-6">
<ArticleToc toc={toc as string} />
<ArticleContent content={html as string} />
<ArticleToc toc={toc} />
<ArticleContent source={source} />
<ArticleDivider>{subtitle || 'Blog'}</ArticleDivider>
<ArticleNav prevPost={prevPost} nextPost={nextPost} />
<ArticleDivider>
Expand Down
Loading

0 comments on commit a9eaef3

Please sign in to comment.