Skip to content

Commit

Permalink
feat: ja doc home (#553)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shhdgit authored Nov 27, 2024
1 parent f9eda8d commit 4bab52b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions gatsby/create-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export const createDocs = async ({
allMdx(
filter: {
fileAbsolutePath: { regex: "/^(?!.*TOC).*$/" }
slug: { nin: ["en/tidb/_docHome", "zh/tidb/_docHome"] }
slug: {
nin: ["en/tidb/_docHome", "zh/tidb/_docHome", "ja/tidb/_docHome"]
}
frontmatter: { draft: { ne: true } }
}
) {
Expand Down Expand Up @@ -251,7 +253,7 @@ export const createDocHome = async ({
const path = generateDocHomeUrl(name, pathConfig);
const navUrl = generateNav(pathConfig);

const locale = [Locale.en, Locale.zh];
const locale = [Locale.en, Locale.zh, Locale.ja];

createPage({
path,
Expand All @@ -263,6 +265,7 @@ export const createDocHome = async ({
// use for edit in github
filePath,
navUrl,
pageUrl: path,
availIn: {
locale,
version: [],
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/MDXContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function MDXContent(props: {
{buildType !== "archive" && (
<CustomNotice name={name} pathConfig={pathConfig} availIn={availIn} />
)}
{language === "ja" && (
{language === "ja" && pageType !== "home" && (
<MachineTranslationNotice
name={name}
pathConfig={pathConfig}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
export function generateDocsHomeUrl(lang?: string) {
switch (lang) {
case "ja":
return "/ja/tidbcloud";
return "/ja/";
case "zh":
return "/zh/";
case "en":
Expand Down

0 comments on commit 4bab52b

Please sign in to comment.