Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow custom outline title (#689) #690

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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