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: start moving a basic component and rendering footer #2801

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
Next Next commit
Make @/ match v1
  • Loading branch information
SamyPesse committed Feb 1, 2025
commit 8df1bf152bd50496a3af954c685c933cc49d3453
4 changes: 2 additions & 2 deletions packages/gitbook-v2/src/app/dynamic/url/[...url]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SiteContentLayout } from '@/components/routes/SiteContentLayout';
import { createDynamicSiteContext } from '@/lib/context';
import { SiteContentLayout } from '@v2/components/routes/SiteContentLayout';
import { createDynamicSiteContext } from '@v2/lib/context';

export default async function RootLayout({
params,
4 changes: 2 additions & 2 deletions packages/gitbook-v2/src/app/dynamic/url/[...url]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SiteContentPage } from '@/components/routes/SiteContentPage';
import { createDynamicSiteContext } from '@/lib/context';
import { SiteContentPage } from '@v2/components/routes/SiteContentPage';
import { createDynamicSiteContext } from '@v2/lib/context';

export default async function Page({ params }: { params: Promise<{ url: string[] }> }) {
const { url } = await params;
6 changes: 3 additions & 3 deletions packages/gitbook-v2/src/app/static/url/[...url]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { unstable_cacheTag as cacheTag } from 'next/cache';
import { SiteContentLayout } from '@/components/routes/SiteContentLayout';
import { getSiteCacheTag } from '@/lib/cache';
import { createStaticSiteContext } from '@/lib/context';
import { SiteContentLayout } from '@v2/components/routes/SiteContentLayout';
import { getSiteCacheTag } from '@v2/lib/cache';
import { createStaticSiteContext } from '@v2/lib/context';

export default async function RootLayout({
params,
6 changes: 3 additions & 3 deletions packages/gitbook-v2/src/app/static/url/[...url]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { unstable_cacheTag as cacheTag } from 'next/cache';
import { createStaticSiteContext } from '@/lib/context';
import { getSiteCacheTag } from '@/lib/cache';
import { SiteContentPage } from '@/components/routes/SiteContentPage';
import { createStaticSiteContext } from '@v2/lib/context';
import { getSiteCacheTag } from '@v2/lib/cache';
import { SiteContentPage } from '@v2/components/routes/SiteContentPage';

export default async function Page({ params }: { params: Promise<{ url: string[] }> }) {
'use cache';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GitBookSiteContext } from '@/lib/context';
import { GitBookSiteContext } from '@v2/lib/context';

/**
* Layout component to render the site content.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GitBookSiteContext } from '@/lib/context';
import { GitBookSiteContext } from '@v2/lib/context';

export async function SiteContentPage({ context }: { context: GitBookSiteContext }) {
const { api } = context;
2 changes: 1 addition & 1 deletion packages/gitbook-v2/src/lib/context.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { headers } from 'next/headers';
import { redirect } from 'next/navigation';
import { GitBookAPI } from '@gitbook/api';
import { GITBOOK_API_TOKEN, GITBOOK_API_URL, GITBOOK_USER_AGENT } from '@/lib/env';
import { GITBOOK_API_TOKEN, GITBOOK_API_URL, GITBOOK_USER_AGENT } from '@v2/lib/env';

/**
* Generic context about rendering content.
2 changes: 1 addition & 1 deletion packages/gitbook-v2/tsconfig.json
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
}
],
"paths": {
"@/*": ["./src/*"],
"@v2/*": ["./src/*"],
"@v1/*": ["../gitbook/src/*"]
}
},