Update image component

This commit is contained in:
DefectingCat
2022-08-18 16:56:29 +08:00
parent 562ba00912
commit 3ad3d96f67
38 changed files with 139 additions and 219 deletions

View File

@ -1,26 +1,11 @@
import remarkFrontmatter from 'remark-frontmatter';
import mdx from '@next/mdx';
import rehypePrism from '@mapbox/rehype-prism';
import composePlugins from 'next-compose-plugins';
import remarkGfm from 'remark-gfm';
import rehypeSlug from 'rehype-slug';
// import { remarkCodeHike } from '@code-hike/mdx';
// import { createRequire } from 'module';
// const require = createRequire(import.meta.url);
// const theme = require('shiki/themes/nord.json');
const composedConfig = composePlugins([
mdx({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkFrontmatter, remarkGfm],
rehypePlugins: [
[rehypePrism, { alias: { vue: 'xml' }, ignoreMissing: true }],
rehypeSlug,
],
providerImportSource: '@mdx-js/react',
},
}),
/** @type {import('next').NextConfig} */
{
reactStrictMode: true,
@ -28,6 +13,7 @@ const composedConfig = composePlugins([
experimental: {
// runtime: 'nodejs',
// outputStandalone: true,
images: { allowFutureImage: true },
},
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
images: { domains: ['avatars.githubusercontent.com'] },