Skip to content

Commit e5833b0

Browse files
committed
Docs config
1 parent c4103ed commit e5833b0

File tree

13 files changed

+49
-43
lines changed

13 files changed

+49
-43
lines changed

docs/config.d.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
export const LANGUAGES: string[];
2-
3-
export const LANGUAGES_SSR: string[];
4-
5-
export const LANGUAGES_IN_PROGRESS: string[];
6-
7-
export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean;
1+
export * from '@mui/docs/config';

docs/config.js

+1-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1 @@
1-
// Valid languages to server-side render in production
2-
const LANGUAGES = ['en'];
3-
4-
// Server side rendered languages
5-
const LANGUAGES_SSR = ['en'];
6-
7-
// Work in progress
8-
const LANGUAGES_IN_PROGRESS = LANGUAGES.slice();
9-
10-
const LANGUAGES_IGNORE_PAGES = (pathname) => {
11-
// We don't have the bandwidth like Qt to translate our blog posts
12-
// https://www.qt.io/zh-cn/blog
13-
if (pathname === '/blog' || pathname.startsWith('/blog/')) {
14-
return true;
15-
}
16-
17-
if (pathname === '/size-snapshot/') {
18-
return true;
19-
}
20-
21-
return false;
22-
};
23-
24-
module.exports = {
25-
LANGUAGES,
26-
LANGUAGES_IN_PROGRESS,
27-
LANGUAGES_SSR,
28-
LANGUAGES_IGNORE_PAGES,
29-
};
1+
module.exports = require('@mui/docs/config');

docs/src/modules/components/AppSearch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import NewspaperRoundedIcon from '@mui/icons-material/NewspaperRounded';
2222
import GlobalStyles from '@mui/material/GlobalStyles';
2323
import { alpha, styled } from '@mui/material/styles';
2424
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
25-
import { LANGUAGES_SSR } from 'docs/config';
25+
import { LANGUAGES_SSR } from '@mui/docs/config';
2626
import Link from 'docs/src/modules/components/Link';
2727
import { useTranslate, useUserLanguage } from '@mui/docs/i18n';
2828
import useLazyCSS from 'docs/src/modules/utils/useLazyCSS';

docs/src/modules/components/Head.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import NextHead from 'next/head';
33
import { useRouter } from 'next/router';
4-
import { LANGUAGES_SSR } from 'docs/config';
4+
import { LANGUAGES_SSR } from '@mui/docs/config';
55
import { useUserLanguage, useTranslate } from '@mui/docs/i18n';
66
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
77

docs/src/modules/utils/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import upperFirst from 'lodash/upperFirst';
22
import camelCase from 'lodash/camelCase';
3-
import { LANGUAGES } from 'docs/config';
3+
import { LANGUAGES } from '@mui/docs/config';
44

55
function pascalCase(str: string) {
66
return upperFirst(camelCase(str));

packages/api-docs-builder-core/baseUi/projectSettings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
import { LANGUAGES } from 'docs/config';
2+
import { LANGUAGES } from '@mui/docs/config';
33
import { ProjectSettings } from '@mui-internal/api-docs-builder';
44
import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages';
55
import {

packages/api-docs-builder-core/joyUi/projectSettings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
import { LANGUAGES } from 'docs/config';
2+
import { LANGUAGES } from '@mui/docs/config';
33
import { ProjectSettings } from '@mui-internal/api-docs-builder';
44
import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages';
55
import {

packages/api-docs-builder-core/materialUi/projectSettings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
import { LANGUAGES } from 'docs/config';
2+
import { LANGUAGES } from '@mui/docs/config';
33
import { ProjectSettings } from '@mui-internal/api-docs-builder';
44
import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages';
55
import {

packages/api-docs-builder-core/muiSystem/projectSettings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
import { LANGUAGES } from 'docs/config';
2+
import { LANGUAGES } from '@mui/docs/config';
33
import { ProjectSettings } from '@mui-internal/api-docs-builder';
44
import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages';
55
import {

packages/api-docs-builder-core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"typescript": "tsc -p tsconfig.json"
1010
},
1111
"dependencies": {
12+
"@mui/docs": "workspace:^",
1213
"@mui-internal/api-docs-builder": "workspace:^",
1314
"@mui/markdown": "workspace:^",
1415
"docs": "workspace:^",
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const LANGUAGES: string[];
2+
3+
export const LANGUAGES_SSR: string[];
4+
5+
export const LANGUAGES_IN_PROGRESS: string[];
6+
7+
export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean;

packages/mui-docs/src/config/index.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Valid languages to server-side render in production
2+
const LANGUAGES = ['en'];
3+
4+
// Server side rendered languages
5+
const LANGUAGES_SSR = ['en'];
6+
7+
// Work in progress
8+
const LANGUAGES_IN_PROGRESS = LANGUAGES.slice();
9+
10+
const LANGUAGES_IGNORE_PAGES = (pathname) => {
11+
// We don't have the bandwidth like Qt to translate our blog posts
12+
// https://www.qt.io/zh-cn/blog
13+
if (pathname === '/blog' || pathname.startsWith('/blog/')) {
14+
return true;
15+
}
16+
17+
if (pathname === '/size-snapshot/') {
18+
return true;
19+
}
20+
21+
return false;
22+
};
23+
24+
module.exports = {
25+
LANGUAGES,
26+
LANGUAGES_IN_PROGRESS,
27+
LANGUAGES_SSR,
28+
LANGUAGES_IGNORE_PAGES,
29+
};

pnpm-lock.yaml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)