Add initial migration to NextJS

This commit is contained in:
Corbin Crutchley
2021-11-06 11:50:09 -07:00
parent abe0dccfd8
commit a61f02d96e
229 changed files with 7550 additions and 28966 deletions

View File

@@ -0,0 +1,19 @@
import Image, {ImageProps} from "next/image";
import { MDXRemote } from "next-mdx-remote";
// this object will contain all the replacements we want to make
const components = {
img: (props: ImageProps) => (
// height and width are part of the props, so they get automatically passed here with {...props}
<Image {...props} layout="responsive" loading="lazy" />
),
};
export function PostRenderer({ post }: { post: string }) {
return (
<>
{/* MDXRemote uses the components prop to decide which html elements to switch for components */}
<MDXRemote compiledSource={post} components={components} />
</>
);
}