Add markdown style

This commit is contained in:
DefectingCat
2022-03-26 22:02:04 +08:00
parent dfc1905d03
commit 3612df3c60
7 changed files with 575 additions and 31 deletions

View File

@ -2,23 +2,27 @@ import remarkFrontmatter from 'remark-frontmatter';
import mdx from '@next/mdx';
import rehypePrism from '@mapbox/rehype-prism';
import remarkToc from 'remark-toc';
import composePlugins from 'next-compose-plugins';
import remarkGfm from 'remark-gfm';
import rehypeSlug from 'rehype-slug';
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkFrontmatter, remarkToc],
rehypePlugins: [rehypePrism],
providerImportSource: '@mdx-js/react',
const composedConfig = composePlugins([
mdx({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkFrontmatter, remarkToc, remarkGfm],
rehypePlugins: [rehypePrism, rehypeSlug],
providerImportSource: '@mdx-js/react',
},
}),
/** @type {import('next').NextConfig} */
{
reactStrictMode: true,
// experimental: {
// reactMode: 'concurrent',
// },
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
},
});
]);
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// experimental: {
// reactMode: 'concurrent',
// },
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
};
export default withMDX(nextConfig);
export default composedConfig;