Skip to content

Commit 8051271

Browse files
committed
feat: change url on build
1 parent 579d0aa commit 8051271

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

apify-docs-theme/src/config.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/* eslint-disable global-require */
2-
// eslint-disable-next-line no-nested-ternary
3-
const absoluteUrl = process.env.LOCALHOST
4-
? 'http://localhost:3000'
5-
: process.env.DEV
6-
? 'http://docs.apify.loc'
7-
: 'https://docs.apify.com';
82

9-
const themeConfig = ({
3+
let absoluteUrl = 'https://docs.apify.com';
4+
5+
if (process.env.LOCALHOST) {
6+
absoluteUrl = 'http://localhost:3000';
7+
} else if (process.env.DEV) {
8+
absoluteUrl = 'http://docs.apify.loc';
9+
} else if (process.env.APIFY_DOCS_ABSOLUTE_URL) {
10+
absoluteUrl = process.env.APIFY_DOCS_ABSOLUTE_URL;
11+
}
12+
13+
const themeConfig = {
1014
docs: {
1115
versionPersistence: 'localStorage',
1216
sidebar: {
@@ -277,7 +281,7 @@ const themeConfig = ({
277281
async: true,
278282
defer: true,
279283
},
280-
});
284+
};
281285

282286
const plugins = [
283287
[
@@ -294,7 +298,9 @@ const plugins = [
294298
return {
295299
resolveLoader: {
296300
alias: {
297-
'roa-loader': require.resolve(`${__dirname}/roa-loader/`),
301+
'roa-loader': require.resolve(
302+
`${__dirname}/roa-loader/`,
303+
),
298304
},
299305
},
300306
};

0 commit comments

Comments
 (0)