From f2445c1de9b69847a5986665dc843f71df123e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez=20Jim=C3=A9nez?= Date: Wed, 13 Jul 2022 22:58:19 +0200 Subject: [PATCH 1/2] feat: add hide right sidebar configuration option --- docs/config/frontmatter-configs.md | 15 +++++++++++++++ src/client/theme-default/components/VPDoc.vue | 9 ++++++--- src/client/theme-default/composables/sidebar.ts | 8 ++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/config/frontmatter-configs.md b/docs/config/frontmatter-configs.md index 25dd222c182e..dc624ff616fe 100644 --- a/docs/config/frontmatter-configs.md +++ b/docs/config/frontmatter-configs.md @@ -199,3 +199,18 @@ interface Feature { details: string } ``` + +## rightsidebar + +- Type: `boolean` + +This option only take effect when `layout` is set to `page`. + +By default, the right aside will be shown, if you want to remove it, configure the option to `false`: + +```yaml +--- +rightsidebar: false +--- +``` + diff --git a/src/client/theme-default/components/VPDoc.vue b/src/client/theme-default/components/VPDoc.vue index c55766781951..eefc803a6150 100644 --- a/src/client/theme-default/components/VPDoc.vue +++ b/src/client/theme-default/components/VPDoc.vue @@ -6,7 +6,7 @@ import VPDocAside from './VPDocAside.vue' import VPDocFooter from './VPDocFooter.vue' const route = useRoute() -const { hasSidebar } = useSidebar() +const { hasSidebar, hasRightSidebar } = useSidebar() const pageName = computed(() => route.path.replace(/[./]+/g, '_').replace(/_html$/, '') @@ -16,7 +16,7 @@ const pageName = computed(() =>