Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b37e8b0
feat: implement new LeftNav and RightNav components for improved navi…
shhdgit Dec 18, 2025
e39608c
chore: update subproject commit reference in docs
shhdgit Dec 18, 2025
0254666
feat: add "Improve this document" link in TitleAction component
shhdgit Dec 18, 2025
468fbf0
fix: update feedback translation for clarity in English and Japanese
shhdgit Dec 18, 2025
af715b7
fix: update TitleAction component for improved layout and button text
shhdgit Dec 19, 2025
6cb99b0
fix: update color in RightNav component for better visibility
shhdgit Dec 22, 2025
5f229c9
fix: conditionally render TOC in RightNav component
shhdgit Jan 7, 2026
8c66aff
feat: enhance header layout and functionality
shhdgit Jan 9, 2026
0915790
Merge branch 'master' into feat/restructure
shhdgit Jan 9, 2026
bc22e86
feat: add new Header components for enhanced navigation and functiona…
shhdgit Jan 10, 2026
a662b03
refactor: enhance header components and introduce mobile navigation
shhdgit Jan 10, 2026
8f3de84
refactor: reorganize getPageType utility for improved structure
shhdgit Jan 10, 2026
ed55166
refactor: replace getPageType with usePageType for improved modularity
shhdgit Jan 10, 2026
b2bd473
refactor: replace KeyboardArrowDownIcon with ChevronDownIcon across c…
shhdgit Jan 10, 2026
5f19cd3
feat: enhance HeaderNav with dynamic navigation configuration
shhdgit Jan 10, 2026
48fdade
feat: enhance navigation components with selected item handling
shhdgit Jan 10, 2026
e88d075
refactor: update HeaderAction and theme for improved button styling
shhdgit Jan 12, 2026
6cad662
refactor: replace ActionButton with Button in FeedbackSection for con…
shhdgit Jan 12, 2026
085f3f5
refactor: improve LangSwitch and theme button styles for consistency
shhdgit Jan 12, 2026
8f5cb40
refactor: simplify Box styling in NavGroup for improved readability
shhdgit Jan 12, 2026
fec2374
refactor: enhance LeftNavTree with session storage for expanded IDs a…
shhdgit Jan 12, 2026
44148c0
feat: implement clearAllNavStates function for navigation state manag…
shhdgit Jan 12, 2026
3fff947
refactor: update VersionSelect component for improved styling and con…
shhdgit Jan 12, 2026
2fbbc44
refactor: enhance theme styles for selected TreeItem states
shhdgit Jan 12, 2026
06485dd
refactor: update CloudPlan imports and usage for consistency
shhdgit Jan 12, 2026
a7d398c
Feat/link resolver v1 (#669)
shhdgit Jan 14, 2026
56953c5
Merge branch 'feat/restructure' of github.com:pingcap/website-docs in…
shhdgit Jan 14, 2026
e2e2965
refactor: remove unused CONFIG import from link resolver configuration
shhdgit Jan 14, 2026
65bacb1
feat: introduce TOCNamespace for improved navigation handling
shhdgit Jan 14, 2026
3741c4a
refactor: update navigation and path handling for TOCNamespace
shhdgit Jan 14, 2026
18fbd59
refactor: enhance URL resolver configuration for tidb and tidb-in-kub…
shhdgit Jan 14, 2026
24aebc1
feat: add link resolver and URL resolver configurations for tidb-oper…
shhdgit Jan 14, 2026
226d15e
refactor: update link and URL resolver configurations for tidb releases
shhdgit Jan 14, 2026
f1ea0ad
refactor: integrate TOCNamespace into documentation components for im…
shhdgit Jan 14, 2026
de7b3d1
refactor: enhance HeaderNavMobile component for improved navigation a…
shhdgit Jan 14, 2026
a988a42
refactor: replace pageUrl with namespace in layout and header compone…
shhdgit Jan 14, 2026
c36af24
refactor: update link resolver configuration to include language support
shhdgit Jan 14, 2026
b352edb
refactor: enhance URL and link resolver functionality with caching an…
shhdgit Jan 14, 2026
67f4e63
refactor: extend TOCNamespace for enhanced navigation in templates
shhdgit Jan 14, 2026
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
2 changes: 1 addition & 1 deletion docs
Submodule docs updated 25020 files
5 changes: 3 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
createDocSearch,
create404,
} = require("./gatsby/create-pages");
const { createExtraType } = require("./gatsby/create-types");
const { createFrontmatter, createNavs } = require("./gatsby/create-types");
const {
createConditionalToc,
} = require("./gatsby/plugin/conditional-toc/conditional-toc");
Expand All @@ -26,6 +26,7 @@ exports.createPages = async ({ graphql, actions }) => {
};

exports.createSchemaCustomization = (options) => {
createExtraType(options);
createFrontmatter(options);
createNavs(options);
createConditionalToc(options);
};
22 changes: 12 additions & 10 deletions gatsby/cloud-plan.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { mdxAstToToc, TocQueryData } from "./toc";
import { generateConfig } from "./path";
import { extractFilesFromToc } from "./toc-filter";
import { CloudPlan } from "shared/interface";
import { CloudPlan } from "../src/shared/interface";
import { calculateFileUrl } from "./url-resolver";

type TocMap = Map<
string,
Expand Down Expand Up @@ -46,7 +47,8 @@ export async function getTidbCloudFilesFromTocs(graphql: any): Promise<TocMap> {

tocNodes.forEach((node: TocQueryData["allMdx"]["nodes"][0]) => {
const { config } = generateConfig(node.slug);
const toc = mdxAstToToc(node.mdxAST.children, config);
const tocPath = calculateFileUrl(node.slug);
const toc = mdxAstToToc(node.mdxAST.children, tocPath || node.slug);
const files = extractFilesFromToc(toc);

// Create a key for this specific locale/repo/version combination
Expand All @@ -59,13 +61,13 @@ export async function getTidbCloudFilesFromTocs(graphql: any): Promise<TocMap> {
let tocType: CloudPlan | null = null;

if (relativePath.includes("TOC.md")) {
tocType = "dedicated";
tocType = CloudPlan.Dedicated;
} else if (relativePath.includes("TOC-tidb-cloud-starter")) {
tocType = "starter";
tocType = CloudPlan.Starter;
} else if (relativePath.includes("TOC-tidb-cloud-essential")) {
tocType = "essential";
tocType = CloudPlan.Essential;
} else if (relativePath.includes("TOC-tidb-cloud-premium")) {
tocType = "premium";
tocType = CloudPlan.Premium;
}

// Initialize the entry if it doesn't exist
Expand Down Expand Up @@ -118,12 +120,12 @@ export function determineInDefaultPlan(

// Check if article is in TOC.md (dedicated)
if (dedicated.has(fileName)) {
return "dedicated";
return CloudPlan.Dedicated;
}

// Check if article is in TOC-tidb-cloud-starter.md but not in TOC.md
if (starter.has(fileName) && !dedicated.has(fileName)) {
return "starter";
return CloudPlan.Starter;
}

// Check if article is only in TOC-tidb-cloud-essential.md
Expand All @@ -132,7 +134,7 @@ export function determineInDefaultPlan(
!dedicated.has(fileName) &&
!starter.has(fileName)
) {
return "essential";
return CloudPlan.Essential;
}

if (
Expand All @@ -141,7 +143,7 @@ export function determineInDefaultPlan(
!dedicated.has(fileName) &&
!starter.has(fileName)
) {
return "premium";
return CloudPlan.Premium;
}

return null;
Expand Down
23 changes: 16 additions & 7 deletions gatsby/create-pages/create-doc-home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { resolve } from "path";
import type { CreatePagesArgs } from "gatsby";
import sig from "signale";

import { Locale, BuildType } from "../../src/shared/interface";
import {
Locale,
BuildType,
TOCNamespace,
TOCNamespaceSlugMap,
} from "../../src/shared/interface";
import {
generateConfig,
generateNav,
generateNavTOCPath,
generateDocHomeUrl,
generateStarterNav,
generateEssentialNav,
} from "../../gatsby/path";
import { DEFAULT_BUILD_TYPE, PageQueryData } from "./interface";

Expand Down Expand Up @@ -86,9 +89,14 @@ export const createDocHome = async ({
nodes.forEach((node) => {
const { id, name, pathConfig, filePath, slug } = node;
const path = generateDocHomeUrl(name, pathConfig);
const navUrl = generateNav(pathConfig);
const starterNavUrl = generateStarterNav(pathConfig);
const essentialNavUrl = generateEssentialNav(pathConfig);
const namespace = TOCNamespace.Home;
const namespaceSlug = TOCNamespaceSlugMap[namespace];
const navUrl = generateNavTOCPath(pathConfig, namespaceSlug);
const starterNavUrl = generateNavTOCPath(pathConfig, "tidb-cloud-starter");
const essentialNavUrl = generateNavTOCPath(
pathConfig,
"tidb-cloud-essential"
);
const locale =
process.env.WEBSITE_BUILD_TYPE === "archive"
? [Locale.en, Locale.zh]
Expand Down Expand Up @@ -118,6 +126,7 @@ export const createDocHome = async ({
feedback: true,
globalHome: true,
},
namespace,
},
});
});
Expand Down
36 changes: 27 additions & 9 deletions gatsby/create-pages/create-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import { resolve } from "path";
import type { CreatePagesArgs } from "gatsby";
import sig from "signale";

import { Locale, Repo, BuildType } from "../../src/shared/interface";
import {
Locale,
Repo,
BuildType,
TOCNamespaceSlugMap,
TOCNamespace,
} from "../../src/shared/interface";
import {
generateConfig,
generateUrl,
generateNav,
generateStarterNav,
generateEssentialNav,
generateNavTOCPath,
getTOCNamespace,
} from "../../gatsby/path";
import { calculateFileUrl } from "../../gatsby/url-resolver";
import { cpMarkdown } from "../../gatsby/cp-markdown";
import {
getTidbCloudFilesFromTocs,
Expand Down Expand Up @@ -112,10 +117,22 @@ export const createDocs = async (createPagesArgs: CreatePagesArgs) => {
return;
}

const path = generateUrl(name, pathConfig);
const navUrl = generateNav(pathConfig);
const starterNavUrl = generateStarterNav(pathConfig);
const essentialNavUrl = generateEssentialNav(pathConfig);
const path = calculateFileUrl(node.slug, true);
if (!path) {
console.info(
`Failed to calculate URL for ${node.slug}, filePath: ${filePath}`
);
return;
}

const namespace = getTOCNamespace(node.slug);
const namespaceSlug = TOCNamespaceSlugMap[namespace];
const navUrl = generateNavTOCPath(pathConfig, namespaceSlug);
const starterNavUrl = generateNavTOCPath(pathConfig, "tidb-cloud-starter");
const essentialNavUrl = generateNavTOCPath(
pathConfig,
"tidb-cloud-essential"
);

const locale = [Locale.en, Locale.zh, Locale.ja]
.map((l) =>
Expand Down Expand Up @@ -157,6 +174,7 @@ export const createDocs = async (createPagesArgs: CreatePagesArgs) => {
feedback: true,
},
inDefaultPlan,
namespace,
},
});

Expand Down
4 changes: 4 additions & 0 deletions gatsby/create-pages/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export interface PageQueryData {
id: string;
frontmatter: { aliases: string[] };
slug: string;
parent: {
fileAbsolutePath: string;
relativePath: string;
} | null;
}[];
};
}
29 changes: 29 additions & 0 deletions gatsby/create-types/create-frontmatter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { CreatePagesArgs } from "gatsby";

export const createFrontmatter = ({ actions }: CreatePagesArgs) => {
const { createTypes } = actions;

const typeDefs = `
"""
Markdown Node
"""
type Mdx implements Node @dontInfer {
frontmatter: Frontmatter
}

"""
Markdown Frontmatter
"""
type Frontmatter {
title: String!
summary: String
aliases: [String!]
draft: Boolean
hide_sidebar: Boolean
hide_commit: Boolean
hide_leftNav: Boolean
}
`;

createTypes(typeDefs);
};
61 changes: 25 additions & 36 deletions gatsby/create-types.ts → gatsby/create-types/create-navs.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
import { CreatePagesArgs } from "gatsby";
import { generateConfig } from "./path";
import { mdxAstToToc } from "./toc";
import { Root, List } from "mdast";
import { mdxAstToToc } from "../toc";
import { Root } from "mdast";
import { calculateFileUrl } from "../url-resolver";

export const createExtraType = ({ actions }: CreatePagesArgs) => {
export const createNavs = ({ actions }: CreatePagesArgs) => {
const { createTypes, createFieldExtension } = actions;

const typeDefs = `
"""
Markdown Node
"""
type Mdx implements Node @dontInfer {
frontmatter: Frontmatter
}

"""
Markdown Frontmatter
"""
type Frontmatter {
title: String!
summary: String
aliases: [String!]
draft: Boolean
hide_sidebar: Boolean
hide_commit: Boolean
hide_leftNav: Boolean
}
`;

createTypes(typeDefs);

createFieldExtension({
name: "navigation",
extend() {
Expand All @@ -55,10 +31,13 @@ export const createExtraType = ({ actions }: CreatePagesArgs) => {
}
);

if (!slug.endsWith("TOC"))
throw new Error(`unsupported query in ${slug}`);
const { config } = generateConfig(slug);
const res = mdxAstToToc(mdxAST.children, config, undefined, true);
const tocPath = calculateFileUrl(slug);
const res = mdxAstToToc(
mdxAST.children,
tocPath || slug,
undefined,
true
);
mdxNode.nav = res;
return res;
},
Expand Down Expand Up @@ -93,8 +72,13 @@ export const createExtraType = ({ actions }: CreatePagesArgs) => {

if (!slug.endsWith("TOC-tidb-cloud-starter"))
throw new Error(`unsupported query in ${slug}`);
const { config } = generateConfig(slug);
const res = mdxAstToToc(mdxAST.children, config, undefined, true);
const tocPath = calculateFileUrl(slug);
const res = mdxAstToToc(
mdxAST.children,
tocPath || slug,
undefined,
true
);
mdxNode.starterNav = res;
return res;
},
Expand Down Expand Up @@ -129,8 +113,13 @@ export const createExtraType = ({ actions }: CreatePagesArgs) => {

if (!slug.endsWith("TOC-tidb-cloud-essential"))
throw new Error(`unsupported query in ${slug}`);
const { config } = generateConfig(slug);
const res = mdxAstToToc(mdxAST.children, config, undefined, true);
const tocPath = calculateFileUrl(slug);
const res = mdxAstToToc(
mdxAST.children,
tocPath || slug,
undefined,
true
);
mdxNode.essentialNav = res;
return res;
},
Expand Down
2 changes: 2 additions & 0 deletions gatsby/create-types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./create-frontmatter";
export * from "./create-navs";
Loading