Skip to content

Commit 4bab52b

Browse files
authored
feat: ja doc home (#553)
* feat: ja doc home * chore: filter ja dochome in normal docs * test: use preview docs * test: use ja preview docs * test: ja doc home * test: ja doc home * fix: docs home url * tweak: use ja/master/_docHome as the source * tweak: hide notice in ja home
1 parent f9eda8d commit 4bab52b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

gatsby/create-pages.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export const createDocs = async ({
3636
allMdx(
3737
filter: {
3838
fileAbsolutePath: { regex: "/^(?!.*TOC).*$/" }
39-
slug: { nin: ["en/tidb/_docHome", "zh/tidb/_docHome"] }
39+
slug: {
40+
nin: ["en/tidb/_docHome", "zh/tidb/_docHome", "ja/tidb/_docHome"]
41+
}
4042
frontmatter: { draft: { ne: true } }
4143
}
4244
) {
@@ -251,7 +253,7 @@ export const createDocHome = async ({
251253
const path = generateDocHomeUrl(name, pathConfig);
252254
const navUrl = generateNav(pathConfig);
253255

254-
const locale = [Locale.en, Locale.zh];
256+
const locale = [Locale.en, Locale.zh, Locale.ja];
255257

256258
createPage({
257259
path,
@@ -263,6 +265,7 @@ export const createDocHome = async ({
263265
// use for edit in github
264266
filePath,
265267
navUrl,
268+
pageUrl: path,
266269
availIn: {
267270
locale,
268271
version: [],

src/components/Layout/MDXContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function MDXContent(props: {
7777
{buildType !== "archive" && (
7878
<CustomNotice name={name} pathConfig={pathConfig} availIn={availIn} />
7979
)}
80-
{language === "ja" && (
80+
{language === "ja" && pageType !== "home" && (
8181
<MachineTranslationNotice
8282
name={name}
8383
pathConfig={pathConfig}

src/shared/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
export function generateDocsHomeUrl(lang?: string) {
3737
switch (lang) {
3838
case "ja":
39-
return "/ja/tidbcloud";
39+
return "/ja/";
4040
case "zh":
4141
return "/zh/";
4242
case "en":

0 commit comments

Comments
 (0)