bump next-mdx-remote

This commit is contained in:
Thomas Ruoff
2021-05-18 23:30:30 +02:00
parent 1166c795aa
commit 95a9e48048
5 changed files with 142 additions and 3209 deletions

3293
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@
"mongoose": "^5.12.10", "mongoose": "^5.12.10",
"next": "^10.2.0", "next": "^10.2.0",
"next-iron-session": "^4.1.13", "next-iron-session": "^4.1.13",
"next-mdx-remote": "^2.1.4", "next-mdx-remote": "^3.0.2",
"p-retry": "^4.5.0", "p-retry": "^4.5.0",
"react": "^17.0.2", "react": "^17.0.2",
"react-calendar": "^3.4.0", "react-calendar": "^3.4.0",

View File

@@ -1,24 +1,22 @@
import { readFileSync } from 'fs' import { readFileSync } from 'fs'
import renderToString from 'next-mdx-remote/render-to-string'
import { serialize } from 'next-mdx-remote/serialize'
import { MDXRemote } from 'next-mdx-remote'
import mdComponents from '../components/mdComponents' import mdComponents from '../components/mdComponents'
import Layout from '../components/layout' import Layout from '../components/layout'
export default function TermsPage({ renderedOutput }) { export default function TermsPage({ source }) {
return ( return (
<Layout> <Layout>
<div <MDXRemote {...source} components={{...mdComponents}} />
className="text-gray-700"
dangerouslySetInnerHTML={{ __html: renderedOutput }}
/>
</Layout> </Layout>
) )
} }
export async function getStaticProps() { export async function getStaticProps() {
const source = readFileSync('./md/impressum.md', 'utf8') const source = readFileSync('./md/impressum.md', 'utf8')
const { renderedOutput } = await renderToString(source, { const mdxSource = await serialize(source)
components: { ...mdComponents }, return { props: { source: mdxSource } }
})
return { props: { renderedOutput } }
} }

View File

@@ -1,24 +1,22 @@
import { readFileSync } from 'fs' import { readFileSync } from 'fs'
import renderToString from 'next-mdx-remote/render-to-string' import { serialize } from 'next-mdx-remote/serialize'
import { MDXRemote } from 'next-mdx-remote'
import mdComponents from '../components/mdComponents' import mdComponents from '../components/mdComponents'
import Layout from '../components/layout' import Layout from '../components/layout'
export default function TermsPage({ renderedOutput }) { export default function TermsPage({ source }) {
return ( return (
<Layout> <Layout>
<div <div className="text-gray-700">
className="text-gray-700" <MDXRemote {...source} components={{...mdComponents}}/>
dangerouslySetInnerHTML={{ __html: renderedOutput }} </div>
/>
</Layout> </Layout>
) )
} }
export async function getStaticProps() { export async function getStaticProps() {
const source = readFileSync('./md/privacy.md', 'utf8') const source = readFileSync('./md/privacy.md', 'utf8')
const { renderedOutput } = await renderToString(source, { const mdxSource = await serialize(source)
components: { ...mdComponents }, return { props: { source: mdxSource } }
})
return { props: { renderedOutput } }
} }

View File

@@ -1,24 +1,24 @@
import { readFileSync } from 'fs' import { readFileSync } from 'fs'
import renderToString from 'next-mdx-remote/render-to-string'
import { serialize } from 'next-mdx-remote/serialize'
import { MDXRemote } from 'next-mdx-remote'
import mdComponents from '../components/mdComponents' import mdComponents from '../components/mdComponents'
import Layout from '../components/layout' import Layout from '../components/layout'
export default function TermsPage({ renderedOutput }) { export default function TermsPage({ source }) {
return ( return (
<Layout> <Layout>
<div <div className="text-gray-700" >
className="text-gray-700" <MDXRemote {...source} components={{...mdComponents}} />
dangerouslySetInnerHTML={{ __html: renderedOutput }} </div>
/>
</Layout> </Layout>
) )
} }
export async function getStaticProps() { export async function getStaticProps() {
const source = readFileSync('./md/terms.md', 'utf8') const source = readFileSync('./md/terms.md', 'utf8')
const { renderedOutput } = await renderToString(source, { const mdxSource = await serialize(source)
components: { ...mdComponents }, return { props: { source: mdxSource } }
})
return { props: { renderedOutput } }
} }