Skip to content

Commit

Permalink
feat: allow custom outline title (#689) (#690)
Browse files Browse the repository at this point in the history
close #689
  • Loading branch information
brc-dd authored Jun 6, 2022
1 parent ce17f50 commit a8a1623
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client/theme-default/components/VPDocAsideOutline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useActiveAnchor
} from '../composables/outline'
const { page, frontmatter } = useData()
const { page, frontmatter, theme } = useData()
const { hasOutline } = useOutline()
Expand All @@ -32,7 +32,9 @@ function handleClick({ target: el }: Event) {
<div class="content">
<div class="outline-marker" ref="marker" />

<div class="outline-title">On this page</div>
<div class="outline-title">
{{ theme.outlineTitle || 'On this page' }}
</div>

<nav aria-labelledby="doc-outline-aria-label">
<span class="visually-hidden" id="doc-outline-aria-label">
Expand Down
7 changes: 7 additions & 0 deletions types/default-theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ export namespace DefaultTheme {
*/
siteTitle?: string | false

/**
* Custom outline title in the aside component.
*
* @default 'On this page'
*/
outlineTitle?: string

/**
* The nav items.
*/
Expand Down

0 comments on commit a8a1623

Please sign in to comment.