Mirror of https://forge.levinkeller.de/levin/dorfarchiv.git
af129ed867f2e97da132cb3375de256c99af1b2b
| 1 | --- |
| 2 | sidebar_position: 1 |
| 3 | --- |
| 4 | |
| 5 | # Create a Page |
| 6 | |
| 7 | Add **Markdown or React** files to `src/pages` to create a **standalone page**: |
| 8 | |
| 9 | - `src/pages/index.js` → `localhost:3000/` |
| 10 | - `src/pages/foo.md` → `localhost:3000/foo` |
| 11 | - `src/pages/foo/bar.js` → `localhost:3000/foo/bar` |
| 12 | |
| 13 | ## Create your first React Page |
| 14 | |
| 15 | Create a file at `src/pages/my-react-page.js`: |
| 16 | |
| 17 | ```jsx title="src/pages/my-react-page.js" |
| 18 | import React from 'react'; |
| 19 | import Layout from '@theme/Layout'; |
| 20 | |
| 21 | export default function MyReactPage() { |
| 22 | return ( |
| 23 | <Layout> |
| 24 | <h1>My React page</h1> |
| 25 | <p>This is a React page</p> |
| 26 | </Layout> |
| 27 | ); |
| 28 | } |
| 29 | ``` |
| 30 | |
| 31 | A new page is now available at [http://localhost:3000/my-react-page](http://localhost:3000/my-react-page). |
| 32 | |
| 33 | ## Create your first Markdown Page |
| 34 | |
| 35 | Create a file at `src/pages/my-markdown-page.md`: |
| 36 | |
| 37 | ```mdx title="src/pages/my-markdown-page.md" |
| 38 | # My Markdown page |
| 39 | |
| 40 | This is a Markdown page |
| 41 | ``` |
| 42 | |
| 43 | A new page is now available at [http://localhost:3000/my-markdown-page](http://localhost:3000/my-markdown-page). |