From 69ef2998c37453ab9c0147e87dd9a6efb41a24a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Thu, 14 Jul 2022 11:25:47 +0200 Subject: [PATCH] feat(theme): support hiding aside component from frontmatter (#980) Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- docs/config/frontmatter-configs.md | 13 +++++++++++++ src/client/theme-default/components/VPDoc.vue | 12 +++++++++--- src/client/theme-default/composables/sidebar.ts | 11 +++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/config/frontmatter-configs.md b/docs/config/frontmatter-configs.md index 25dd222c..8503a5ed 100644 --- a/docs/config/frontmatter-configs.md +++ b/docs/config/frontmatter-configs.md @@ -199,3 +199,16 @@ interface Feature { details: string } ``` + +## aside + +- Type: `boolean` +- Default: `true` + +If you want the right aside component in `doc` layout not to be shown, set this option to `false`. + +```yaml +--- +aside: false +--- +``` diff --git a/src/client/theme-default/components/VPDoc.vue b/src/client/theme-default/components/VPDoc.vue index c5576678..9f07347d 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, hasAside } = useSidebar() const pageName = computed(() => route.path.replace(/[./]+/g, '_').replace(/_html$/, '') @@ -14,9 +14,12 @@ const pageName = computed(() =>