Skip to content

Commit a732078

Browse files
authored
Update Pages article (#876)
* update Pages * fix code sample
1 parent b986025 commit a732078

File tree

1 file changed

+67
-102
lines changed

1 file changed

+67
-102
lines changed

pages.mdx

Lines changed: 67 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -4,170 +4,135 @@ description: "Pages are the building blocks of your documentation"
44
icon: "letter-text"
55
---
66

7-
## Basics
7+
Each page is an MDX file, which combines Markdown content with React components to let you create rich, interactive documentation.
88

9-
Each page is an MDX file that should begin with `---` at the start and end. This is used to define the page's metadata, such as the title and description.
9+
## Page metadata
1010

11-
For example, you can define the title for this page as follows.
11+
Every page starts with frontmatter—YAML metadata enclosed by `---` at the beginning of your file. This metadata controls how your page appears and behaves.
1212

13-
```mdx
14-
---
15-
title: "Your title goes here"
16-
---
17-
```
13+
<ResponseField name="title" type="string" required>
14+
The title of your page that appears in navigation and browser tabs.
15+
</ResponseField>
1816

19-
## Descriptions
17+
<ResponseField name="description" type="string">
18+
A brief description of what this page covers. Appears under the title and improves SEO.
19+
</ResponseField>
2020

21-
You can add a description that shows the summary of the page under the title with the `description` metadata.
21+
<ResponseField name="sidebarTitle" type="string">
22+
A short title that displays in the sidebar navigation.
23+
</ResponseField>
2224

23-
```mdx
24-
---
25-
description: "Your description goes here"
26-
---
27-
```
25+
<ResponseField name="icon" type="string">
26+
An icon next to your page title in the sidebar. Choose an icon from Font Awesome, Lucide, or use a custom URL. Configure your preferred icon library with the [icons library setting](/settings#param-icons).
2827

29-
## Sidebar Title
28+
</ResponseField>
3029

31-
If you want to show a different title in the navigation, you can set the `sidebarTitle` metadata. This is useful if your title is long and you want something shorter in the navigation links.
30+
<ResponseField name="tag" type="string">
31+
A tag that appears next to your page title in the sidebar.
32+
</ResponseField>
3233

33-
```mdx
34+
```yaml Example YAML frontmatter wrap
3435
---
35-
title: "Your very long page title you want to shorten"
36-
sidebarTitle: "Short title"
36+
title: "About frontmatter"
37+
description: "Frontmatter is the metadata that controls how your page appears and behaves"
38+
sidebarTitle: "Frontmatter"
39+
icon: "book"
40+
tag: "NEW"
3741
---
3842
```
3943

40-
## Icons
41-
42-
Add an icon next to your page's sidebar title by including the `icon` field in your page's frontmatter.
44+
## Page mode
4345

44-
```mdx
45-
---
46-
title: "Code Block"
47-
icon: "code"
48-
---
49-
```
46+
Control how your page displays with the `mode` setting.
5047

51-
You can set icons from a URL, [Font Awesome](https://fontawesome.com/icons), or [Lucide](https://lucide.dev/icons). Choose your preferred icon library (Font Awesome or Lucide) with the [icon library setting](settings#param-icons).
48+
### Default
5249

53-
For Font Awesome icons, you can optionally set the icon type. If not set, the icon type will be regular.
50+
If no mode is defined, defaults to a standard layout with a sidebar navigation and table of contents.
5451

55-
```mdx
52+
```yaml
5653
---
57-
iconType: "solid"
54+
title: "Default page title"
5855
---
5956
```
6057

61-
## Tag
58+
### Wide
6259

63-
Add tags to label specific pages. Tags display in the sidebar next to page titles.
60+
Wide mode hides the table of contents. This is useful for pages that do not have any headings or if you prefer to use the extra horizontal space.
6461

65-
```mdx
66-
---
67-
tag: "NEW"
62+
```yaml
6863
---
69-
```
70-
71-
## API Pages
72-
73-
API pages let you build interactive API playgrounds. To create an API page, you
74-
must set an `api` or `openapi` property in the page metadata.
75-
76-
Learn more about API pages by visiting the [API page guides](/api-playground/overview).
77-
78-
```mdx
79-
---
80-
openapi: "GET /endpoint"
64+
title: "Wide page title"
65+
mode: "wide"
8166
---
8267
```
8368

84-
## Page Mode
85-
86-
The Page Mode setting allows you to customize the appearance of your page. You can choose from
87-
different modes to adjust the layout according to your needs. If no mode is specified, the page
88-
will use the default settings.
89-
90-
### Default
69+
### Custom
9170

92-
If no specific mode is given, the page will default to standard settings. This means the page
93-
will display the default table of contents and other standard elements.
71+
Custom mode provides a minimalist layout that removes all elements except for the top navbar. Custom mode is a blank canvas to create landing pages or any other unique layouts that you want to have minimal navigation elements for.
9472

95-
```mdx
73+
```yaml
9674
---
97-
title: "Default page title"
75+
title: "Custom page title"
76+
mode: "custom"
9877
---
9978
```
10079

101-
### Wide Mode
80+
### Center
10281

103-
In Wide Mode, you can hide the table of contents (ToC) on the right side of the page. This is
104-
particularly useful if your page doesn’t have any headings or if you prefer to utilize the
105-
extra horizontal space for more content.
82+
Center mode removes the sidebar and table of contents, centering the content. This is useful for changelogs or other pages where you want to emphasize the content.
10683

107-
```mdx
84+
```yaml
10885
---
109-
mode: "wide"
86+
title: "Center page title"
87+
mode: "center"
11088
---
11189
```
11290

113-
### Custom Mode
91+
## API pages
11492

115-
Custom Mode provides a minimalist layout by removing all elements except for the top bar.
116-
This mode offers a blank canvas, which is ideal for creating a "landing page" or any page where
117-
you want a clean, distraction-free environment.
93+
Create interactive API playgrounds by adding an API specification to your frontmatter, `api` or `openapi`.
11894

119-
```mdx
95+
```yaml
12096
---
121-
mode: "custom"
97+
openapi: "GET /endpoint"
12298
---
12399
```
124100

125-
### Center Mode
101+
Learn more about building [API documentation](/api-playground/overview).
126102

127-
Center Mode removes the sidebar and the table of contents, and centers the page content. This mode is great for changelogs
128-
or any page where you want to focus on the content.
103+
## External links
129104

130-
```mdx
131-
---
132-
mode: "center"
133-
---
134-
```
135-
136-
## External Links
105+
Link to external sites directly from your navigation with the `url` metadata.
137106

138-
If you want the sidebar to open an external URL, you can set the `url` metadata
139-
in any page.
140-
141-
```mdx
107+
```yaml
142108
---
143-
title: "Page that goes to external link"
109+
title: "npm Package"
144110
url: "https://www.npmjs.com/package/mint"
145111
---
146112
```
147113

148-
## Search Engine Optimization
114+
## Search engine optimization
149115

150-
You can set meta tags like the image set when shared on social media by passing
151-
them into your page's metadata.
116+
Most SEO meta tags are automatically generated. You can set SEO meta tags manually to improve your site's SEO, social sharing, and browser compatibility.
152117

153-
Note that meta tags with colons need to be wrapped in quotes.
118+
<Note>
119+
Meta tags with colons must be wrapped in quotes.
120+
</Note>
154121

155-
```mdx
122+
```yaml
156123
---
157-
"twitter:image": "/images/your-photo.jpg"
124+
"twitter:image": "/images/social-preview.jpg"
158125
---
159126
```
160127

161-
See [SEO](/settings/seo) to learn more about SEO metadata.
128+
See [SEO](/settings/seo) for complete SEO metadata options.
162129

163-
## Internal Search Optimization
130+
## Internal search keywords
164131

165-
You can also enhance a specific page's discoverability in the built-in search by
166-
providing `keywords` in your metadata. These keywords won't appear as part of the page
167-
content or in search results, but users that search for them will be shown the page as a result.
132+
Enhance a specific page's discoverability in the built-in search by providing `keywords` in your metadata. These keywords won't appear as part of the page content or in search results, but users that search for them will be shown the page as a result.
168133

169-
```mdx
134+
```yaml
170135
---
171-
keywords: ['search', 'indexing']
136+
keywords: ['configuration', 'setup', 'getting started']
172137
---
173-
```
138+
```

0 commit comments

Comments
 (0)