Skip to content

Commit 5ccf71a

Browse files
Add mdx page example to examples/app-dir-mdx (#47082)
This PR affects the `examples/app-dir-mdx` project. Currently, only an example of importing a `.mdx` file (`message.mdx`) into the `page.tsx` file is shown. However, a more common example would be using a `.mdx` file as a page, e.g., in a blog scenario. I added an example for this, enabled the page extension to allow `.mdx` pages, and changed the body's height, which is a cosmetic change for the newly created blog page.
1 parent 3323702 commit 5ccf71a

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Hello World
2+
3+
This is an example blog page with MDX support.

examples/app-dir-mdx/app/globals.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ html,
8383
body {
8484
max-width: 100vw;
8585
overflow-x: hidden;
86+
height: 100%;
8687
}
8788

8889
body {

examples/app-dir-mdx/next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3+
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
34
experimental: {
45
appDir: true,
56
mdxRs: true,

0 commit comments

Comments
 (0)