From b3b81eab4e2ad67aa169d343f6b6b80e0b16be38 Mon Sep 17 00:00:00 2001 From: Jacob Milhorn <68669571+earlAchromatic@users.noreply.github.com> Date: Thu, 7 Jul 2022 21:43:17 -0400 Subject: [PATCH 1/7] docs: fix typos (#920) --- docs/guide/theme-nav.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/theme-nav.md b/docs/guide/theme-nav.md index 81575e9b..a01012f6 100644 --- a/docs/guide/theme-nav.md +++ b/docs/guide/theme-nav.md @@ -114,7 +114,7 @@ export default { ### Customize link's "active" state -Nav menu items will be highlighted when the current page is under the matching path. if you would like to customize the path to be mathced, define `activeMatch` property and regex as a string value. +Nav menu items will be highlighted when the current page is under the matching path. if you would like to customize the path to be matched, define `activeMatch` property and regex as a string value. ```js export default { From 88877b7dd9ab9f227474570418d8a501b285251f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=B5=E8=B0=A6?= Date: Fri, 8 Jul 2022 09:44:15 +0800 Subject: [PATCH 2/7] docs: fix typos (#916) --- docs/guide/theme-team-page.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guide/theme-team-page.md b/docs/guide/theme-team-page.md index f19b52d5..e2510473 100644 --- a/docs/guide/theme-team-page.md +++ b/docs/guide/theme-team-page.md @@ -60,9 +60,9 @@ The above will display a team member in card looking element. It should display -`` component comes in 2 different sizes, `small` and `medium`. While it boiles down to your preference, usually `small` size should fit better when used in doc page. Also, you may add more properties to each member such as adding "description" or "sponsor" button. Learn more about it in [``](#vpteammembers). +`` component comes in 2 different sizes, `small` and `medium`. While it boils down to your preference, usually `small` size should fit better when used in doc page. Also, you may add more properties to each member such as adding "description" or "sponsor" button. Learn more about it in [``](#vpteammembers). -Embbeding team members in doc page is good for small size team where having dedicated full team page might be too much, or introducing partial members as a refference to documenation context. +Embbeding team members in doc page is good for small size team where having dedicated full team page might be too much, or introducing partial members as a reference to documentation context. If you have large number of members, or simply would like to have more space to show team members, consider [creating a full team page](#create-a-full-team-page). @@ -217,7 +217,7 @@ interface TeamMember { ## `` -The root component when creating a full team page. It only accepts a single slot. It's will style all passed in team related components. +The root component when creating a full team page. It only accepts a single slot. It will style all passed in team related components. ## `` From 0f0453c6750c5af9c1ae65abb994813eecf9af27 Mon Sep 17 00:00:00 2001 From: Sacha STAFYNIAK Date: Fri, 8 Jul 2022 07:41:06 +0200 Subject: [PATCH 3/7] feat(theme): add navigation slots (#739) (#741) Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- docs/guide/theme-introduction.md | 9 +++++++++ src/client/theme-default/Layout.vue | 9 ++++++++- src/client/theme-default/components/VPNav.vue | 12 ++++++++++-- src/client/theme-default/components/VPNavBar.vue | 7 ++++++- .../theme-default/components/VPNavBarTitle.vue | 2 ++ src/client/theme-default/components/VPNavScreen.vue | 2 ++ 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/docs/guide/theme-introduction.md b/docs/guide/theme-introduction.md index 09d56d66..2e0b4be0 100644 --- a/docs/guide/theme-introduction.md +++ b/docs/guide/theme-introduction.md @@ -201,3 +201,12 @@ Full list of slots available in the default theme layout: - `home-hero-after` - `home-features-before` - `home-features-after` +- Always: + - `layout-top` + - `layout-bottom` + - `nav-bar-title-before` + - `nav-bar-title-after` + - `nav-bar-content-before` + - `nav-bar-content-after` + - `nav-screen-content-before` + - `nav-screen-content-after` diff --git a/src/client/theme-default/Layout.vue b/src/client/theme-default/Layout.vue index 5087ee46..9008519a 100644 --- a/src/client/theme-default/Layout.vue +++ b/src/client/theme-default/Layout.vue @@ -29,7 +29,14 @@ provide('close-sidebar', closeSidebar) - + + + + + + + + diff --git a/src/client/theme-default/components/VPNav.vue b/src/client/theme-default/components/VPNav.vue index 6e0c61a8..2331d085 100644 --- a/src/client/theme-default/components/VPNav.vue +++ b/src/client/theme-default/components/VPNav.vue @@ -13,8 +13,16 @@ provide('close-screen', closeScreen) diff --git a/src/client/theme-default/components/VPNavBar.vue b/src/client/theme-default/components/VPNavBar.vue index dc383d7d..0791f156 100644 --- a/src/client/theme-default/components/VPNavBar.vue +++ b/src/client/theme-default/components/VPNavBar.vue @@ -23,15 +23,20 @@ const { hasSidebar } = useSidebar() diff --git a/src/client/theme-default/components/VPNavScreen.vue b/src/client/theme-default/components/VPNavScreen.vue index 7204ac8f..67972f46 100644 --- a/src/client/theme-default/components/VPNavScreen.vue +++ b/src/client/theme-default/components/VPNavScreen.vue @@ -29,10 +29,12 @@ function unlockBodyScroll() { >
+
From 95f21f8c9eff5a7f89bbde95aafecd44f8adbd8b Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 8 Jul 2022 12:57:06 +0530 Subject: [PATCH 4/7] docs: add node.js version to deployment notes (#944) --- docs/guide/deploying.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guide/deploying.md b/docs/guide/deploying.md index cffcf03e..5765bef5 100644 --- a/docs/guide/deploying.md +++ b/docs/guide/deploying.md @@ -55,6 +55,7 @@ Set up a new project and change these settings using your dashboard: - **Build Command:** `yarn docs:build` - **Output Directory:** `docs/.vitepress/dist` +- **Node Version:** `14` (or above, by default it usually will be 14 or 16, but on Cloudflare Pages the default is still 12, so you may need to [change that](https://developers.cloudflare.com/pages/platform/build-configuration/)) ::: warning Don't enable options like _Auto Minify_ for HTML code. It will remove comments from output which have meaning to Vue. You may see hydration mismatch errors if they get removed. From 95a74e58a4969b44b6057aa4a1eb54b67d1bc325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eulier=20Gonz=C3=A1lez?= Date: Fri, 8 Jul 2022 06:16:22 -0300 Subject: [PATCH 5/7] docs: add including markdown content to guide (#938) Co-authored-by: Eulier Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- docs/guide/markdown.md | 42 +++++++++++++++++++++++++++++++++++++++ src/node/markdownToVue.ts | 14 ++++++++----- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md index 39716fef..342904e5 100644 --- a/docs/guide/markdown.md +++ b/docs/guide/markdown.md @@ -388,6 +388,48 @@ You can also use a [VS Code region](https://code.visualstudio.com/docs/editor/co +## Markdown File Inclusion + +You can include a markdown file in another markdown file like this: + +**Input** + +```md +# Docs + +## Basics + + +``` + +**Part file** (`parts/basics.md`) + +```md +Some getting started stuff. + +### Configuration + +Can be created using `.foorc.json`. +``` + +**Equivalent code** + +```md +# Docs + +## Basics + +Some getting started stuff. + +### Configuration + +Can be created using `.foorc.json`. +``` + +::: warning +Note that this does not throw errors if your file is not present. Hence, when using this feature make sure that the contents are being rendered as expected. +::: + ## Advanced Configuration VitePress uses [markdown-it](https://github.com/markdown-it/markdown-it) as the Markdown renderer. A lot of the extensions above are implemented via custom plugins. You can further customize the `markdown-it` instance using the `markdown` option in `.vitepress/config.js`: diff --git a/src/node/markdownToVue.ts b/src/node/markdownToVue.ts index 86a07750..eeb567a3 100644 --- a/src/node/markdownToVue.ts +++ b/src/node/markdownToVue.ts @@ -54,11 +54,15 @@ export async function createMarkdownToVueRenderFn( // resolve includes let includes: string[] = [] - src = src.replace(includesRE, (_, m1) => { - const includePath = path.join(dir, m1) - const content = fs.readFileSync(includePath, 'utf-8') - includes.push(slash(includePath)) - return content + src = src.replace(includesRE, (m, m1) => { + try { + const includePath = path.join(dir, m1) + const content = fs.readFileSync(includePath, 'utf-8') + includes.push(slash(includePath)) + return content + } catch (error) { + return m // silently ignore error if file is not present + } }) const { content, data: frontmatter } = matter(src) From 1e9a7ac6c478c57d7336e2d7b0392f23659080d3 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 8 Jul 2022 15:03:59 +0530 Subject: [PATCH 6/7] fix: treat all URI schemes as external (#945) (#946) --- src/client/theme-default/components/VPButton.vue | 3 ++- src/client/theme-default/components/VPLink.vue | 3 ++- src/client/theme-default/support/utils.ts | 4 ++-- src/shared/shared.ts | 2 +- src/shared/tsconfig.json | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/theme-default/components/VPButton.vue b/src/client/theme-default/components/VPButton.vue index 0f818d9a..714f3e0c 100644 --- a/src/client/theme-default/components/VPButton.vue +++ b/src/client/theme-default/components/VPButton.vue @@ -1,6 +1,7 @@