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()} 🚧`,