From e5bf15a21ee777b4e56ad86ec5ebb5b0e161b721 Mon Sep 17 00:00:00 2001 From: Percy Ma Date: Sat, 4 Jun 2022 00:34:21 +0800 Subject: [PATCH 01/15] fix: nav nested items type error (#710) (#711) --- types/default-theme.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/default-theme.d.ts b/types/default-theme.d.ts index 2f44cd11..80ecbeff 100644 --- a/types/default-theme.d.ts +++ b/types/default-theme.d.ts @@ -81,7 +81,7 @@ export namespace DefaultTheme { export interface NavItemWithChildren { text?: string - items: NavItemWithLink[] + items: NavItem[] } // sidebar ------------------------------------------------------------------- From 5f62fcd7409307f8b24dcc8486923de6566fa9a7 Mon Sep 17 00:00:00 2001 From: Romain Bioteau Date: Fri, 3 Jun 2022 18:42:09 +0200 Subject: [PATCH 02/15] docs: specify location of the public folder (#700) --- docs/guide/asset-handling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/asset-handling.md b/docs/guide/asset-handling.md index 20969f9c..dd6105a4 100644 --- a/docs/guide/asset-handling.md +++ b/docs/guide/asset-handling.md @@ -16,7 +16,7 @@ All **static** path references, including absolute paths, should be based on you ## Public Files -Sometimes you may need to provide static assets that are not directly referenced in any of your Markdown or theme components (for example, favicons and PWA icons). The `public` directory under project root can be used as an escape hatch to provide static assets that either are never referenced in source code (e.g. `robots.txt`), or must retain the exact same file name (without hashing). +Sometimes you may need to provide static assets that are not directly referenced in any of your Markdown or theme components (for example, favicons and PWA icons). The `public` directory under project root (`docs` folder if you're running `vitepress build docs`) can be used as an escape hatch to provide static assets that either are never referenced in source code (e.g. `robots.txt`), or must retain the exact same file name (without hashing). Assets placed in `public` will be copied to the root of the dist directory as-is. From 78a2e84e7bb7acfda50e686bbd404961babb91e8 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 3 Jun 2022 22:20:41 +0530 Subject: [PATCH 03/15] fix: add default value for base in `createMarkdownRenderer` (#555) (#556) --- src/node/markdown/markdown.ts | 2 +- src/node/markdownToVue.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/markdown/markdown.ts b/src/node/markdown/markdown.ts index 1ed38025..dbf24e29 100644 --- a/src/node/markdown/markdown.ts +++ b/src/node/markdown/markdown.ts @@ -56,7 +56,7 @@ export type { Header } export const createMarkdownRenderer = async ( srcDir: string, options: MarkdownOptions = {}, - base: string + base = '/' ): Promise => { const md = MarkdownIt({ html: true, diff --git a/src/node/markdownToVue.ts b/src/node/markdownToVue.ts index 273d4dc1..8dca195e 100644 --- a/src/node/markdownToVue.ts +++ b/src/node/markdownToVue.ts @@ -27,7 +27,7 @@ export async function createMarkdownToVueRenderFn( pages: string[], userDefines: Record | undefined, isBuild = false, - base: string, + base = '/', includeLastUpdatedData = false ) { const md = await createMarkdownRenderer(srcDir, options, base) From 31c863d14c42eba06881964b81fe1806505d6157 Mon Sep 17 00:00:00 2001 From: 0x009922 Date: Fri, 3 Jun 2022 20:16:36 +0300 Subject: [PATCH 04/15] docs: fix docs for usage of regions in snippets (#421) --- docs/guide/markdown.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md index 846b867f..39716fef 100644 --- a/docs/guide/markdown.md +++ b/docs/guide/markdown.md @@ -364,12 +364,12 @@ It also supports [line highlighting](#line-highlighting-in-code-blocks): The value of `@` corresponds to the source root. By default it's the VitePress project root, unless `srcDir` is configured. ::: -You can also use a [VS Code region](https://code.visualstudio.com/docs/editor/codebasics#_folding) to only include the corresponding part of the code file. You can provide a custom region name after a `#` following the filepath (`snippet` by default): +You can also use a [VS Code region](https://code.visualstudio.com/docs/editor/codebasics#_folding) to only include the corresponding part of the code file. You can provide a custom region name after a `#` following the filepath: **Input** ```md -<<< @/snippets/snippet-with-region.js{1} +<<< @/snippets/snippet-with-region.js#snippet{1} ``` **Code file** From 8e5015462c8f42c5404525ac8de33af8862c204d Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sat, 4 Jun 2022 18:12:56 +0530 Subject: [PATCH 05/15] fix: use base in links (#717) (#718) --- src/client/theme-default/components/VPButton.vue | 3 ++- src/client/theme-default/components/VPNavBarTitle.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/theme-default/components/VPButton.vue b/src/client/theme-default/components/VPButton.vue index d6c5d246..e1d3408a 100644 --- a/src/client/theme-default/components/VPButton.vue +++ b/src/client/theme-default/components/VPButton.vue @@ -1,5 +1,6 @@ diff --git a/types/default-theme.d.ts b/types/default-theme.d.ts index 80ecbeff..5ef6169c 100644 --- a/types/default-theme.d.ts +++ b/types/default-theme.d.ts @@ -93,7 +93,7 @@ export namespace DefaultTheme { } export interface SidebarGroup { - text: string + text?: string items: SidebarItem[] /** From a8a16237cd8e3e4bb180fbd523a4668a4555b732 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 6 Jun 2022 10:03:29 +0530 Subject: [PATCH 09/15] feat: allow custom outline title (#689) (#690) close #689 --- src/client/theme-default/components/VPDocAsideOutline.vue | 6 ++++-- types/default-theme.d.ts | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/client/theme-default/components/VPDocAsideOutline.vue b/src/client/theme-default/components/VPDocAsideOutline.vue index 26b556ad..b4b17908 100644 --- a/src/client/theme-default/components/VPDocAsideOutline.vue +++ b/src/client/theme-default/components/VPDocAsideOutline.vue @@ -7,7 +7,7 @@ import { useActiveAnchor } from '../composables/outline' -const { page, frontmatter } = useData() +const { page, frontmatter, theme } = useData() const { hasOutline } = useOutline() @@ -32,7 +32,9 @@ function handleClick({ target: el }: Event) {
-
On this page
+
+ {{ theme.outlineTitle || 'On this page' }} +