diff --git a/.changeset/cold-cameras-work.md b/.changeset/cold-cameras-work.md new file mode 100644 index 000000000..5eed9ac12 --- /dev/null +++ b/.changeset/cold-cameras-work.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Don't add extra page scroll when footer is not present diff --git a/packages/gitbook/src/app/middleware/(site)/(content)/[[...pathname]]/not-found.tsx b/packages/gitbook/src/app/middleware/(site)/(content)/[[...pathname]]/not-found.tsx index cd36e5b26..d218b9aa2 100644 --- a/packages/gitbook/src/app/middleware/(site)/(content)/[[...pathname]]/not-found.tsx +++ b/packages/gitbook/src/app/middleware/(site)/(content)/[[...pathname]]/not-found.tsx @@ -15,7 +15,15 @@ export default async function NotFound() { return (

diff --git a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx index a214c22d8..4dc5be4fb 100644 --- a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx +++ b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx @@ -78,6 +78,12 @@ export async function SpaceLayout(props: { const visitorAuthToken = await getCurrentVisitorToken(); const enabled = await shouldTrackEvents(); + const withFooter = + customization.themes.toggeable || + customization.footer.copyright || + customization.footer.logo || + customization.footer.groups?.length; + return ( @@ -174,10 +180,7 @@ export async function SpaceLayout(props: {

- {customization.themes.toggeable || - customization.footer.copyright || - customization.footer.logo || - customization.footer.groups?.length ? ( + {withFooter ? (