Skip to content

Commit ad64083

Browse files
committed
tweak: banner path
1 parent 2a4bb7a commit ad64083

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/Layout/Header/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,17 @@ const HeaderBanner = (props: HeaderProps) => {
435435
const { t } = useI18next();
436436
const { namespace } = props;
437437
const isAutoTranslation = useIsAutoTranslation(namespace);
438+
const trailPath = props.name === "_index" ? "" : props.name;
438439
const urlAutoTranslation =
439440
namespace === TOCNamespace.TidbCloudReleases && props.name === "_index"
440441
? `/releases/tidb-cloud/`
441442
: namespace === TOCNamespace.AI
442-
? `/ai/${props.name === "_index" ? "" : props.name}`
443+
? `/ai/${trailPath}`
443444
: namespace === TOCNamespace.TiDBCloud
444-
? `/tidbcloud/${props.name === "_index" ? "" : props.name}`
445-
: `/${props.pathConfig?.repo}/${props.pathConfig?.version || "stable"}/${
446-
props.name === "_index" ? "" : props.name
447-
}`;
445+
? `/tidbcloud/${trailPath}`
446+
: `/${props.pathConfig?.repo}/${
447+
props.pathConfig?.version || "stable"
448+
}/${trailPath}`;
448449

449450
let archivedTargetUrl = "";
450451
if (props.name && props.pathConfig) {

0 commit comments

Comments
 (0)