Creating a new page
You can create a new page by creating a new .mdx
file in the src/pages
directory.
By default, the name of the page in the sidebar will be the name of the .mdx
file.
You can change this by reading the Custom Pathname page.
Creating a new .mdx file
To create a new page, you need to create a new .mdx
file in the src/pages
directory.
If a GUI is unavailable, please scroll down to the NOGUI section.
- Navigate to the
src/pages
directory. - Create a new
.mdx
file. - Add the following frontmatter to the top of the file:
---
layout: '@layouts/Layout.astro'
---
- Add your content below the frontmatter. This can be MDX, HTML, or a mix of both.
Adding the page to the sidebar
To add the new page to the sidebar, you need to modify the src/config/sidebar.json
file.
Instructions on how to do this can be found on the Sidebar page.
NOGUI
If you are unable to use a GUI, you can create a new .mdx
file using the command line.
- Open a terminal.
- Navigate to the root directory of the project.
- Run the following command:
touch src/pages/page_name.mdx
(Replace page_name
with the name of your new page)
- Open the new
.mdx
file usingnano
nano src/pages/page_name.mdx
- Add the following frontmatter to the top of the file:
---
layout: '@layouts/Layout.astro'
---
- Add your content below the frontmatter. This can be MDX, HTML, or a mix of both.