Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: search and ask AI #2889

Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Simplify"
This reverts commit b95dd06.
  • Loading branch information
SamyPesse committed Mar 3, 2025
commit 84d71c7e03b2752cc2a3401485ed0caef469c90f
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import {
generateSiteLayoutViewport,
} from '@/components/SiteLayout';
import { type RouteLayoutParams, getDynamicSiteContext } from '@v2/app/utils';
import { GITBOOK_DISABLE_TRACKING } from '@v2/lib/env';
import { getThemeFromMiddleware, getVisitorAuthTokenFromMiddleware } from '@v2/lib/middleware';

interface SiteDynamicLayoutProps {
@@ -24,6 +25,7 @@ export default async function SiteDynamicLayout({
<SiteLayout
context={context}
forcedTheme={forcedTheme}
withTracking={!GITBOOK_DISABLE_TRACKING}
visitorAuthToken={visitorAuthToken}
>
{children}
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import {
} from '@/components/SiteLayout';
import { type RouteLayoutParams, getStaticSiteContext } from '@v2/app/utils';
import { getSiteCacheTag } from '@v2/lib/cache';
import { GITBOOK_DISABLE_TRACKING } from '@v2/lib/env';
import { unstable_cacheTag as cacheTag } from 'next/cache';

interface SiteStaticLayoutProps {
@@ -24,7 +25,11 @@ export default async function SiteStaticLayout({

return (
<CustomizationRootLayout customization={context.customization}>
<SiteLayout context={context} visitorAuthToken={null}>
<SiteLayout
context={context}
withTracking={!GITBOOK_DISABLE_TRACKING}
visitorAuthToken={null}
>
{children}
</SiteLayout>
</CustomizationRootLayout>
9 changes: 7 additions & 2 deletions packages/gitbook/src/components/SiteLayout/SiteLayout.tsx
Original file line number Diff line number Diff line change
@@ -23,10 +23,11 @@ export async function SiteLayout(props: {
nonce?: string;
context: GitBookSiteContext;
forcedTheme?: CustomizationThemeMode | null;
withTracking: boolean;
visitorAuthToken: string | null;
children: React.ReactNode;
}) {
const { context, nonce, forcedTheme, visitorAuthToken, children } = props;
const { context, nonce, forcedTheme, withTracking, visitorAuthToken, children } = props;

const { scripts, customization } = context;

@@ -51,7 +52,11 @@ export async function SiteLayout(props: {
(customization.themes.toggeable ? undefined : customization.themes.default)
}
>
<SpaceLayout context={context} visitorAuthToken={visitorAuthToken}>
<SpaceLayout
context={context}
withTracking={withTracking}
visitorAuthToken={visitorAuthToken}
>
{children}
</SpaceLayout>

Loading
Oops, something went wrong.