Markdown Page - Create Pages with Markdown
You can create new static pages without writing React. Just add a Markdown file in the src/pages folder and Docusaurus will automatically convert it into a full page with a navbar and footer.
This is the easiest way to create About, Terms, Privacy, Pricing details, and other simple pages.
Folder Location
All static pages live in:
src/pages/
index.js-> becomes the homepage/about.js-> becomes/aboutcontact.js-> becomes/contactproduct.js-> becomes/product- Any
.mdfile you create here becomes a page automatically
Example:
src/pages/whychoseus.md-> becomeshttps://yourdomain.com/whychoseussrc/pages/terms.md-> becomeshttps://yourdomain.com/termssrc/pages/privacy.md-> becomeshttps://yourdomain.com/privacy
How to Create a Markdown Page
Step 1: Create a new file
- Open the
src/pages/folder in VS Code - Right-click > New File
- Name it with your page name, always lowercase, and use a dash for spaces. Example:
whychoseus.md,why-chose-us.md, orpricing-details.md
Step 2: Add frontmatter
Every Markdown page must start with frontmatter. Frontmatter is metadata at the top between --- lines. This controls the SEO and title.
---
title: Hey Markdown Page in here
description: This description about your markdown files..
image: img/docusaurus.png
---
write your markdown article in here...
Explanation of frontmatter fields:
title: Page title. Shows in the browser tab, navbar breadcrumb, and Google search title. Required.description: Meta description for SEO (150-160 chars). Shows in Google under your link. Also used for the social sharing preview.image: Social card image for Twitter, Facebook, and Discord sharing. Use a path from thestatic/img/folder likeimg/docusaurus.pngorimg/cover.jpg. Recommended size: 1200x630px.
Step 3: Write content
After the frontmatter, write your article in Markdown:
---
title: Why Choose Us
description: Learn why Docusar is the best Docusaurus template for your documentation site
image: img/why-choose-us.png
---
# Why Choose Us
Welcome to our Why Choose Us page.
## Fast and Modern
Docusar is built with React and Docusaurus, so it is super fast and SEO-ready.
## Easy to Edit
You don't need to hardcode. Just edit JSON and Markdown.
### Features:
- No coding needed
- Dark and light mode
- Blog and docs included
[Contact Us](/contact)
Markdown syntax you can use:
# Titlefor H1,## Titlefor H2,###for H3- listor1. listfor a bullet or number list[text](link)for links - use/contactfor internal,https://...for externalfor images - put the image instatic/img/**bold**and*italic*- Code block with
js ...
Step 4: Save and check
- Save the file
- Run
npm run startif it is not running - Open
http://localhost:3000/whychoseus(replace with your filename without .md) - Your page will appear with the navbar and footer automatically.
Update a Markdown Article
If you want to edit an existing Markdown static page:
- Open the
src/pages/folder - Find your file, for example
basic.md,standard.md, or your custom file - Open it with your code editor
- Edit the title, description, or content in Markdown
- Save and refresh the browser
You do not need to restart the server. Docusaurus hot-reloads Markdown changes.
Delete a Markdown Article
To delete a Markdown article page:
- Go to
src/pages/ - Delete the
.mdfile you want to remove - Save. The route will no longer exist (404)
- If you linked this page in
docusaurus.config.jsnavbar or footer, remove that link too, otherwise users will get a 404.
Tips:
- Use
.mdfor simple pages, use.mdxif you need React components inside Markdown (like custom cards or buttons) - Keep the filename lowercase, no spaces, use dashes:
terms-of-service.md, notTerms Of Service.md - If you need a complex layout with sections, pricing, and images, use a React page
.jswith JSON instead of Markdown - Markdown pages automatically use the Docusaurus default page layout - they are perfect for Terms, Privacy, License, and FAQ detail pages