Skip to content

Commit 3992202

Browse files
brc-ddttdly
andcommitted
docs: add themeConfig.outline, drop themeConfig.outlineTitle
Co-authored-by: =?UTF-8?q?=E7=A7=83=E5=A4=B4=E7=81=AF=E7=AC=BC=E9=B1=BC?= <[email protected]>
1 parent fb93460 commit 3992202

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

docs/reference/default-theme-config.md

+27-20
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default {
6666

6767
The configuration for the nav menu item. More details in [Default Theme: Nav](./default-theme-nav#navigation-links).
6868

69-
```js
69+
```ts
7070
export default {
7171
themeConfig: {
7272
nav: [
@@ -113,7 +113,7 @@ interface NavItemWithChildren {
113113

114114
The configuration for the sidebar menu item. More details in [Default Theme: Sidebar](./default-theme-sidebar).
115115

116-
```js
116+
```ts
117117
export default {
118118
themeConfig: {
119119
sidebar: [
@@ -174,26 +174,33 @@ Setting this value to `false` prevents rendering of aside container.\
174174
Setting this value to `true` renders the aside to the right.\
175175
Setting this value to `left` renders the aside to the left.
176176
177-
## outline
177+
If you want to disable it for all viewports, you should use `outline: false` instead.
178178
179-
- Type: `number | [number, number] | 'deep' | false`
180-
- Default: `2`
181-
- Can be overridden per page via [frontmatter](./frontmatter-config#outline)
182-
183-
The levels of header to display in the outline. You can specify a particular level by passing a number, or you can provide a level range by passing a tuple containing the bottom and upper limits. When passing `'deep'` which equals `[2, 6]`, all header levels are shown in the outline except `h1`. Set `false` to hide outline.
179+
## outline
184180
185-
## outlineTitle
181+
- Type: `Outline | Outline['level'] | false`
182+
- Level can be overridden per page via [frontmatter](./frontmatter-config#outline)
186183
187-
- Type: `string`
188-
- Default: `On this page`
184+
Setting this value to `false` prevents rendering of outline container. Refer this interface for more details:
189185
190-
Can be used to customize the title of the right sidebar (on the top of outline links). This is useful when writing documentation in another language.
186+
```ts
187+
interface Outline {
188+
/**
189+
* The levels of headings to be displayed in the outline.
190+
* Single number means only headings of that level will be displayed.
191+
* If a tuple is passed, the first number is the minimum level and the second number is the maximum level.
192+
* `'deep'` is same as `[2, 6]`, which means all headings from `<h2>` to `<h6>` will be displayed.
193+
*
194+
* @default 2
195+
*/
196+
level?: number | [number, number] | 'deep'
191197

192-
```js
193-
export default {
194-
themeConfig: {
195-
outlineTitle: 'In hac pagina'
196-
}
198+
/**
199+
* The title to be displayed on the outline.
200+
*
201+
* @default 'On this page'
202+
*/
203+
label?: string
197204
}
198205
```
199206

@@ -203,7 +210,7 @@ export default {
203210

204211
You may define this option to show your social account links with icons in nav.
205212

206-
```js
213+
```ts
207214
export default {
208215
themeConfig: {
209216
socialLinks: [
@@ -275,7 +282,7 @@ export interface Footer {
275282

276283
Edit Link lets you display a link to edit the page on Git management services such as GitHub, or GitLab. See [Default Theme: Edit Link](./default-theme-edit-link) for more details.
277284

278-
```js
285+
```ts
279286
export default {
280287
themeConfig: {
281288
editLink: {
@@ -374,7 +381,7 @@ Learn more in [Default Theme: Carbon Ads](./default-theme-carbon-ads)
374381

375382
Can be used to customize text appearing above previous and next links. Helpful if not writing docs in English. Also can be used to disable prev/next links globally. If you want to selectively enable/disable prev/next links, you can use [frontmatter](./default-theme-prev-next-links).
376383

377-
```js
384+
```ts
378385
export default {
379386
themeConfig: {
380387
docFooter: {

docs/reference/frontmatter-config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ aside: false
159159
- Type: `number | [number, number] | 'deep' | false`
160160
- Default: `2`
161161
162-
The levels of header in the outline to display for the page. It's same as [config.themeConfig.outline](./default-theme-config#outline), and it overrides the theme config.
162+
The levels of header in the outline to display for the page. It's same as [config.themeConfig.outline.level](./default-theme-config#outline), and it overrides the value set in site-level config.
163163
164164
### lastUpdated
165165

src/client/theme-default/components/VPNavBar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const classes = ref<Record<string, boolean>>({})
3131
watchPostEffect(() => {
3232
classes.value = {
3333
'has-sidebar': hasSidebar.value,
34-
top: frontmatter.value?.layout === 'home' && y.value === 0,
34+
top: frontmatter.value.layout === 'home' && y.value === 0,
3535
}
3636
})
3737
</script>

0 commit comments

Comments
 (0)