-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🕹️ feat: create remote markdown page
- Loading branch information
1 parent
77f52b3
commit 1e2143b
Showing
4 changed files
with
1,471 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import withMDX from '@next/mdx' | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
export default nextConfig; | ||
const nextConfig = { | ||
// Configure `pageExtensions` to include MDX files | ||
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'], | ||
// Optionally, add any other Next.js config below | ||
} | ||
|
||
export default withMDX()(nextConfig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { MDXRemote } from 'next-mdx-remote/rsc' | ||
|
||
export default async function RemoteMdxPage() { | ||
// MDX text - can be from a local file, database, CMS, fetch, anywhere... | ||
const res = await fetch('https://raw.githubusercontent.com/restrainhalation/cw-the-book-of-devil-excerpt/main/README.md') | ||
const markdown = await res.text() | ||
return <MDXRemote source={markdown} /> | ||
} |
Oops, something went wrong.