fix(i18n): pathPrefix for languages at subpath
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
const path = require('path');
|
||||
const config = require('./config/env');
|
||||
|
||||
const {
|
||||
clientLocale,
|
||||
curriculumLocale,
|
||||
homeLocation
|
||||
} = require('../config/env');
|
||||
const {
|
||||
buildChallenges,
|
||||
replaceChallengeNode,
|
||||
@ -8,12 +12,17 @@ const {
|
||||
} = require('./utils/buildChallenges');
|
||||
|
||||
const curriculumIntroRoot = path.resolve(__dirname, './src/pages');
|
||||
const pathPrefix =
|
||||
clientLocale === 'english' || clientLocale === 'chinese'
|
||||
? ''
|
||||
: '/' + clientLocale;
|
||||
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
title: 'freeCodeCamp',
|
||||
siteUrl: config.homeLocation
|
||||
siteUrl: homeLocation
|
||||
},
|
||||
pathPrefix: pathPrefix,
|
||||
plugins: [
|
||||
'gatsby-plugin-react-helmet',
|
||||
'gatsby-plugin-postcss',
|
||||
@ -34,7 +43,7 @@ module.exports = {
|
||||
options: {
|
||||
name: 'challenges',
|
||||
source: buildChallenges,
|
||||
onSourceChange: replaceChallengeNode(config.curriculumLocale),
|
||||
onSourceChange: replaceChallengeNode(curriculumLocale),
|
||||
curriculumPath: localeChallengesRootDir
|
||||
}
|
||||
},
|
||||
|
@ -85,7 +85,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"prebuild": "echo 'Client workers building...' && npm run build:workers && echo 'Client workers ready.' && node ../tools/scripts/build/ensure-env.js",
|
||||
"build": "node --max_old_space_size=7168 node_modules/gatsby-cli build",
|
||||
"build": "node --max_old_space_size=7168 node_modules/gatsby-cli build --prefix-paths",
|
||||
"build:workers": "node --max_old_space_size=7168 node_modules/webpack-cli --env.production --config ./webpack-workers.js && echo",
|
||||
"build:workers:debug": "node --max_old_space_size=7168 node_modules/webpack-cli --env.production --config ./webpack-workers.js --progress",
|
||||
"clean": "gatsby clean",
|
||||
|
Reference in New Issue
Block a user