mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
chore(v2): setup for i18n staging deployment (#4214)
This commit is contained in:
parent
7f6c4be2f3
commit
1b3c9be530
1 changed files with 29 additions and 11 deletions
|
@ -41,8 +41,33 @@ const isBootstrapPreset = process.env.DOCUSAURUS_PRESET === 'bootstrap';
|
||||||
|
|
||||||
const isVersioningDisabled = !!process.env.DISABLE_VERSIONING;
|
const isVersioningDisabled = !!process.env.DISABLE_VERSIONING;
|
||||||
|
|
||||||
|
// Special deployment for staging locales until they get enough translations
|
||||||
|
// https://app.netlify.com/sites/docusaurus-i18n-staging
|
||||||
|
// https://docusaurus-i18n-staging.netlify.app/
|
||||||
|
const isI18nStaging = process.env.I18N_STAGING === 'true';
|
||||||
|
|
||||||
|
const LocaleConfigs = isI18nStaging
|
||||||
|
? // Staging locales (https://docusaurus-i18n-staging.netlify.app/)
|
||||||
|
{
|
||||||
|
en: {
|
||||||
|
label: 'English',
|
||||||
|
},
|
||||||
|
'zh-CN': {
|
||||||
|
label: '简体中文',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: // Production locales
|
||||||
|
{
|
||||||
|
en: {
|
||||||
|
label: 'English',
|
||||||
|
},
|
||||||
|
fr: {
|
||||||
|
label: 'Français',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
||||||
module.exports = {
|
(module.exports = {
|
||||||
title: 'Docusaurus',
|
title: 'Docusaurus',
|
||||||
tagline: 'Build optimized websites quickly, focus on your content',
|
tagline: 'Build optimized websites quickly, focus on your content',
|
||||||
organizationName: 'facebook',
|
organizationName: 'facebook',
|
||||||
|
@ -52,15 +77,8 @@ module.exports = {
|
||||||
url: 'https://v2.docusaurus.io',
|
url: 'https://v2.docusaurus.io',
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: 'en',
|
defaultLocale: 'en',
|
||||||
locales: ['en', 'fr'],
|
locales: Object.keys(LocaleConfigs),
|
||||||
localeConfigs: {
|
localeConfigs: LocaleConfigs,
|
||||||
en: {
|
|
||||||
label: 'English',
|
|
||||||
},
|
|
||||||
fr: {
|
|
||||||
label: 'Français',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
onBrokenLinks: 'throw',
|
onBrokenLinks: 'throw',
|
||||||
onBrokenMarkdownLinks: 'warn',
|
onBrokenMarkdownLinks: 'warn',
|
||||||
|
@ -441,4 +459,4 @@ module.exports = {
|
||||||
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`,
|
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue