Skip to content

Latest commit

 

History

History
113 lines (79 loc) · 2.42 KB

page.mdx

File metadata and controls

113 lines (79 loc) · 2.42 KB
title description
Page Titles and Metadata
Setting the title and metadata for navigation and SEO

The Basics

Each page is an MDX file that should begin with the following metadata syntax with --- at the start and end:

---
title: [title of the page]
---
---
title: "Page"
---

Mintlify will use the name of the file if you forget to include a title.

Other metadata goes in between the same --- lines. For example, this page uses this metadata:

---
title: "Page Titles and Metadata"
description: "Metadata is important for API pages and SEO optimization"
---

API Pages

API pages let you build interactive API playgrounds. To create an API page, you must set an api or openapi property in the page metadata.

Learn more about API playgrounds in our demo.

api or openapi: [method] [endpoint]
api: "GET /users"
openapi: "GET /users"

Descriptions

You can show a description that shows directly under the title with the description metadata.

description: "Your description goes here."

Sidebar Title

You can show a different title in the navigation with the sidebarTitle metadata. This is useful if your title is long and you want something shorter in the navigation links.

---
title: "Your very long page title you want to shorten"
sidebarTitle: "Short title"
---

Sidebar Icons

Want an icon for your sidebar item like the ones in components? You can set an icon attribute in the metadata! All icons from Font Awesome are available for us. You can also set an icon type (optional). If not set, the icon type will be regular.

---
title: "Code Block"
icon: "rectangle-code"
iconType: "solid"
---

External Links

If you want the sidebar to open an external URL, you can set the url metadata in any page.

---
title: "Page that goes to external link"
url: "https://www.npmjs.com/package/mintlify"
---

Search Engine Optimization

You can set meta tags like the image set when shared on social media by passing them into your page's metadata. Meta tags with colons need to be wrapped in quotes.

"twitter:image": "/images/your-photo.jpg"

See our SEO page for all supported meta tags.