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' ? (