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.

  1. Navigate to the src/pages directory.
  2. Create a new .mdx file.
  3. Add the following frontmatter to the top of the file:
---
layout: '@layouts/Layout.astro'
---
  1. 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.

  1. Open a terminal.
  2. Navigate to the root directory of the project.
  3. Run the following command:
touch src/pages/page_name.mdx

(Replace page_name with the name of your new page)

  1. Open the new .mdx file using nano
nano src/pages/page_name.mdx
  1. Add the following frontmatter to the top of the file:
---
layout: '@layouts/Layout.astro'
---
  1. Add your content below the frontmatter. This can be MDX, HTML, or a mix of both.