fix(live-codeblock): render static codeblock server-side (#5754)

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Joshua Chen 2021-10-21 23:17:03 +08:00 committed by GitHub
parent 9ad6de2b85
commit 1c8b8362f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 13 deletions

View file

@ -38,6 +38,9 @@ const isDev = process.env.NODE_ENV === 'development';
const isDeployPreview =
process.env.NETLIFY && process.env.CONTEXT === 'deploy-preview';
// Used to debug production build issues faster
const isBuildFast = !!process.env.BUILD_FAST;
const baseUrl = process.env.BASE_URL || '/';
// Special deployment for staging locales until they get enough translations
@ -252,10 +255,11 @@ const config = {
rehypePlugins: [katex],
disableVersioning: isVersioningDisabled,
lastVersion: isDev ? 'current' : undefined,
onlyIncludeVersions:
!isVersioningDisabled && (isDev || isDeployPreview)
? ['current', ...versions.slice(0, 2)]
: undefined,
onlyIncludeVersions: isBuildFast
? ['current']
: !isVersioningDisabled && (isDev || isDeployPreview)
? ['current', ...versions.slice(0, 2)]
: undefined,
versions: {
current: {
label: `${getNextBetaVersionName()} 🚧`,

View file

@ -16,6 +16,7 @@
"build:baseUrl": "cross-env BASE_URL='/build/' yarn build",
"start:blogOnly": "cross-env yarn start --config=docusaurus.config-blog-only.js",
"build:blogOnly": "cross-env yarn build --config=docusaurus.config-blog-only.js",
"build:fast": "cross-env BUILD_FAST=true yarn build --locale en",
"netlify:build:production": "yarn docusaurus write-translations && yarn netlify:crowdin:delay && yarn netlify:crowdin:uploadSources && yarn netlify:crowdin:downloadTranslations && yarn build",
"netlify:build:deployPreview": "yarn docusaurus write-translations --locale fr --messagePrefix '(fr) ' && yarn build",
"netlify:crowdin:delay": "node delayCrowdin.js",