From a028e70c834f72e84077593e4a5aa257c6a41afa Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Fri, 3 Oct 2025 19:58:11 +0200 Subject: [PATCH] Hide sections if only one is present --- .changeset/afraid-cougars-happen.md | 5 +++++ packages/gitbook/src/components/Header/Header.tsx | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/afraid-cougars-happen.md diff --git a/.changeset/afraid-cougars-happen.md b/.changeset/afraid-cougars-happen.md new file mode 100644 index 0000000000..5d7e210255 --- /dev/null +++ b/.changeset/afraid-cougars-happen.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Hide sections if only one is present diff --git a/packages/gitbook/src/components/Header/Header.tsx b/packages/gitbook/src/components/Header/Header.tsx index 257a00792a..7b9bfbf6e9 100644 --- a/packages/gitbook/src/components/Header/Header.tsx +++ b/packages/gitbook/src/components/Header/Header.tsx @@ -178,7 +178,9 @@ export function Header(props: { - {sections ? ( + {sections && + (sections.list.length > 1 || // Show section tabs if there are at least 2 sections or at least 1 section group + sections.list.some((s) => s.object === 'site-section-group')) ? (
{withVariants === 'translations' ? (