Skip to content

fix: en docs content fallback #281

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

Merged
merged 5 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion docs/viz/9-message-schemas/circle-annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: CircleAnnotation

## 父级架构

`CircleAnnotation` 出现在 [`ImageAnnotations`](/image-annotations) 消息模式中。
`CircleAnnotation` 出现在 [`ImageAnnotations`](../message-schemas/image-annotations) 消息模式中。

## 字段定义

Expand Down
7 changes: 7 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

import { themes } from 'prism-react-renderer';

const defaultExclude = ['**/_*.{js,jsx,ts,tsx,md,mdx}', '**/_*/**', '**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**'];

// some docs are not translated, so we need to exclude them in en
const excludeInEn = ['**/viz/8-extensions/**', '**/viz/9-message-schemas/**'];

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'coScene',
Expand Down Expand Up @@ -60,6 +65,8 @@ const config = {
// editUrl: 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
exclude:
process.env.DOCUSAURUS_CURRENT_LOCALE === 'en' ? [...defaultExclude, ...excludeInEn] : defaultExclude,
},
blog: false,
// blog: {
Expand Down
5 changes: 1 addition & 4 deletions i18n/en/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,6 @@
"home.catalogue.frame-rate-optimization": {
"message": "Frame Rate Optimization"
},
"home.catalogue.extensions": {
"message": "Extensions"
},
"home.catalogue.options": {
"message": "Visualization Options"
},
Expand Down Expand Up @@ -602,4 +599,4 @@
"home.catalogue.apt-source-install": {
"message": "Installing coScene Software via APT"
}
}
}
12 changes: 7 additions & 5 deletions src/components/homeCatalogue/catalogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ export const CATALOGUE = [
docLink: '/viz/frame-rate-optimization',
title: translate({ id: 'home.catalogue.frame-rate-optimization', message: '帧率优化选项' }),
},
{ docLink: '/category/extensions', title: translate({ id: 'home.catalogue.extensions', message: '插件' }) },
{
docLink: '/viz/message-schemas',
title: translate({ id: 'home.catalogue.message-schemas', message: '消息架构' }),
},
...(typeof process !== 'undefined' && process.env.DOCUSAURUS_CURRENT_LOCALE === 'zh' ? [
{ docLink: '/category/extensions', title: translate({ id: 'home.catalogue.extensions', message: '插件' }) },
{
docLink: '/viz/message-schemas',
title: translate({ id: 'home.catalogue.message-schemas', message: '消息架构' }),
},
] : []),
],
},
{
Expand Down