mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-01 08:34:24 +00:00
Add outdated component to outdated documents (#25)
- `git log` needs all commit history to compare latest commit of files, so changed `git clone --depth=1` to `git clone`. This will make the step take longer, so might be improved if there is a better way. - `src/theme/MDXContent/index.js` is from [ejecting of the component](https://docusaurus.io/docs/swizzling#ejecting) inside `@docusaurus/theme-classic` plugin, and this one is safe to eject according to docusaurus   - [Outdated component style reference](https://mui.com/material-ui/react-alert/) - Added [`Translate` component](https://docusaurus.io/docs/next/docusaurus-core#translate) to `Outdated` so it can be localized. [reference](https://docusaurus.io/docs/next/i18n/tutorial#translate-your-react-code) - One way to check for the specific outdated documents: search for `lastest commit timestamp` in [prepare nightly docs and prepare 1.19 docs steps](https://gitea.com/gitea/gitea-docusaurus/actions/runs/74) # After The Chinese documents that are outdated (latest commit is ealier than laster commit of English version):    Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/25 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: HesterG <hestergong@gmail.com> Co-committed-by: HesterG <hestergong@gmail.com>
This commit is contained in:
@@ -24,12 +24,11 @@ const config = {
|
||||
favicon: 'img/favicon.png',
|
||||
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'zh-cn'/*, 'fr-fr', 'zh-tw'*/], // temporarily disable other locales
|
||||
defaultLocale: 'en-us',
|
||||
locales: ['en-us', 'zh-cn'/*, 'fr-fr', 'zh-tw'*/], // temporarily disable other locales
|
||||
localeConfigs: {
|
||||
'en': {
|
||||
'en-us': {
|
||||
label: 'English',
|
||||
htmlLang: 'en-US',
|
||||
},
|
||||
'zh-cn': {
|
||||
label: '中文',
|
||||
@@ -47,15 +46,12 @@ const config = {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
routeBasePath: '/', // Serve the docs at the site's root
|
||||
editUrl: ({versionDocsDirPath, docPath, locale, version, permalink}) => {
|
||||
let fileName = `doc/${docPath.replace('.md', '')}.en-us.md`;
|
||||
if (locale === 'zh-cn') {
|
||||
fileName = `doc/${docPath.replace('.md', '')}.zh-cn.md`;
|
||||
}
|
||||
let fileName = `doc/${docPath.replace('.md', '')}.${locale}.md`;
|
||||
// intro.md has different name from upstream, need to handle this here
|
||||
if (docPath.includes('intro.md')) {
|
||||
fileName = locale === 'zh-cn' ? 'page/index.zh-cn.md': 'page/index.en-us.md';
|
||||
fileName = `page/index.${locale}.md`;
|
||||
}
|
||||
return `https://github.com/go-gitea/gitea/tree/main/docs/content/${fileName}`;
|
||||
return `https://github.com/go-gitea/gitea/tree/${version === 'current' ? 'main': `release/v${version}`}/docs/content/${fileName}`;
|
||||
},
|
||||
versions: {
|
||||
current: {
|
||||
|
||||
Reference in New Issue
Block a user