Skip to content

Commit 7a3ec7b

Browse files
authored
feat: Add configurable search engine indexing behavior [internal] (#1642)
If the `NO_INDEX` environment variable is used during build, the [`noIndex` Docusaurus config](https://docusaurus.io/docs/api/docusaurus-config#noIndex) will be used and the docs will be built so that they're not indexable by search engines.
1 parent 31baff7 commit 7a3ec7b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

apify-docs-theme/src/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ if (process.env.LOCALHOST) {
1010
absoluteUrl = process.env.APIFY_DOCS_ABSOLUTE_URL;
1111
}
1212

13+
const noIndex = ['true', '1'].includes(process.env.NO_INDEX ?? '');
14+
1315
const themeConfig = {
1416
docs: {
1517
versionPersistence: 'localStorage',
@@ -313,4 +315,5 @@ module.exports = {
313315
themeConfig,
314316
plugins,
315317
absoluteUrl,
318+
noIndex,
316319
};

docusaurus.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
title: 'Apify Documentation',
1313
tagline: 'Apify Documentation',
1414
url: config.absoluteUrl,
15+
noIndex: config.noIndex,
1516
baseUrl: '/',
1617
trailingSlash: false,
1718
organizationName: 'apify',

0 commit comments

Comments
 (0)