diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index e62d3c97..d1428ed1 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,5 +1,7 @@ import { defineConfig } from '../../src/node' +import { version } from '../../package.json' + export default defineConfig({ lang: 'en-US', title: 'VitePress', @@ -48,9 +50,18 @@ function nav() { { text: 'Guide', link: '/guide/what-is-vitepress', activeMatch: '/guide/' }, { text: 'Configs', link: '/config/introduction', activeMatch: '/config/' }, { - text: 'Changelog', - link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md' - } + text: version, + items: [ + { + text: 'Changelog', + link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md' + }, + { + text: 'Contributing', + link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md' + }, + ], + }, ] } diff --git a/docs/config/theme-configs.md b/docs/config/theme-configs.md index 4ebfdc87..eb40afdf 100644 --- a/docs/config/theme-configs.md +++ b/docs/config/theme-configs.md @@ -247,9 +247,33 @@ export default { ```ts export interface CarbonAds { - code: string, + code: string placement: string } ``` Learn more in [Theme: Carbon Ads](../guide/theme-carbon-ads) + +## docFooter + +- Type: `DocFooter` + +Can be used to customize text appearing above previous and next links. Helpful if not writing docs in English. + +```js +export default { + themeConfig: { + docFooter: { + prev: 'Pagina prior', + next: 'Proxima pagina' + } + } +} +``` + +```ts +export interface DocFooter { + prev?: string + next?: string +} +``` diff --git a/docs/guide/theme-nav.md b/docs/guide/theme-nav.md index 92413974..81575e9b 100644 --- a/docs/guide/theme-nav.md +++ b/docs/guide/theme-nav.md @@ -51,7 +51,7 @@ export default { } ``` -The `text` is the actual text displayed in nav, and the `link` is the link that will be navigated to when the text is clicked. For the link, set path to the actual file without `.md` prefix, and alsways start with `/`. +The `text` is the actual text displayed in nav, and the `link` is the link that will be navigated to when the text is clicked. For the link, set path to the actual file without `.md` prefix, and always start with `/`. Nav links can also be dropdown menus. To do this, set `items` key on link option. diff --git a/docs/guide/theme-prev-next-link.md b/docs/guide/theme-prev-next-link.md index c248d1f3..e52f9057 100644 --- a/docs/guide/theme-prev-next-link.md +++ b/docs/guide/theme-prev-next-link.md @@ -1,3 +1,29 @@ # Prev Next Link -Documentation coming soon... +You can customize the text of previous and next links. This is helpful if you want to show different text on previous/next links than what you have on your sidebar. + +## prev + +- Type: `string` + +- Details: + + Specify the text to show on the link to the previous page. + + If you don't set this in frontmatter, the text will be inferred from the sidebar config. + +- Example: + +```yaml +--- +prev: 'Get Started | Markdown' +--- +``` + +## next + +- Type: `string` + +- Details: + + Same as `prev` but for the next page. diff --git a/src/client/theme-default/Layout.vue b/src/client/theme-default/Layout.vue index 7af05e9d..5087ee46 100644 --- a/src/client/theme-default/Layout.vue +++ b/src/client/theme-default/Layout.vue @@ -1,5 +1,6 @@