Skip to content

Commit 1eeb096

Browse files
committed
create docs, and root npm scripts to build, run next dev server for it.
1 parent 8ebbc64 commit 1eeb096

13 files changed

+12719
-783
lines changed

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
.DS_Store
3+
# dist
4+
# dist-ssr
5+
*.local
6+
7+
# docs website
8+
/docs

docs/.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env
29+
.env.local
30+
.env.development.local
31+
.env.test.local
32+
.env.production.local
33+
34+
# vercel
35+
.vercel

docs/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Example app with MDX
2+
3+
This example shows using [MDX](https://github.com/mdx-js/mdx) as top level pages for your next.js app.
4+
5+
## Preview
6+
7+
Preview the example live on [StackBlitz](http://stackblitz.com/):
8+
9+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-mdx)
10+
11+
## Deploy your own
12+
13+
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
14+
15+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-mdx&project-name=with-mdx&repository-name=with-mdx)
16+
17+
## How to use
18+
19+
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
20+
21+
```bash
22+
npx create-next-app --example with-mdx with-mdx-app
23+
# or
24+
yarn create next-app --example with-mdx with-mdx-app
25+
```
26+
27+
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

docs/components/button.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default function Button({ children }) {
2+
return (
3+
<button
4+
style={{
5+
borderRadius: '3px',
6+
border: '1px solid black',
7+
color: 'black',
8+
padding: '0.5em 1em',
9+
cursor: 'pointer',
10+
fontSize: '1.1em',
11+
}}
12+
>
13+
{children}
14+
</button>
15+
)
16+
}

docs/next.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const withMDX = require('@next/mdx')({
2+
extension: /\.mdx?$/,
3+
})
4+
module.exports = withMDX({
5+
pageExtensions: ['js', 'jsx', 'mdx'],
6+
})

0 commit comments

Comments
 (0)