Custom Pathname
This is a page with a custom pathname. The path for this .mdx
file is src/pages/info.mdx
, however notice that the title of this page on the sidebar is ‘Custom Pathname’. This is because the path
frontmatter field has been set to ‘Custom Pathname’. This page explains how to set it.
Setting the path
To set the name of the page in the sidebar, you can add a path
key to the frontmatter of the .mdx
file. The value of the path
key will be the name of the page in the sidebar.
---
path: 'Custom Pathname'
---
Setting the pathname for a directory
To set the name of a directory in the sidebar, you need to title the directory accordingly. For example, the src/pages/more
directory has been named ‘More’ in the sidebar.
There is no special frontmatter required for directories. The name of the directory in the sidebar is the name of the directory in the src/pages
directory.