Skip to content

feat(build): add DOCS_PRIVATE_BUILD flag for private staging sites - #1847

Closed
jth-nw wants to merge 1 commit into
devfrom
feat/private-build-flag
Closed

jth-nw wants to merge 1 commit into
devfrom
feat/private-build-flag

Conversation

@jth-nw

@jth-nw jth-nw commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a DOCS_PRIVATE_BUILD=true build flag. When set, the build leaves out Google Analytics, the production Algolia search, and the Algolia preconnect tag, and swaps the search box for a null component.

noIndex and robots.txt already follow the site URL (src/config/indexing.js), so a private host is covered by setting APP_EXTERNAL_URL to a non-docs.netwrix.com URL.

Needed so a separate private repo can build a hidden staging site (1Secure Beta) on top of this framework. The flag is generic and unset by default, so normal builds are unchanged.

Test plan

  • APP_EXTERNAL_URL=https://beta.example.net DOCS_PRIVATE_BUILD=true DOCS_PRODUCT=1secure npm run build succeeds; output has noindex, nofollow, Disallow: /, no gtag, no Algolia, no search box
  • Full private-repo flow (overlay + npm run ci) builds a 1Secure Beta-only site
  • Normal build with the flag unset still includes gtag and search (CI build on this PR)

🤖 Generated with Claude Code

Leaves out Google Analytics and the production Algolia search when
DOCS_PRIVATE_BUILD=true. noindex and robots.txt already follow the
site URL, so a private host is covered without extra config.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Code Review

No correctness issues found.

Checked:

  • resolve is already imported from path in docusaurus.config.js, so the alias in the stub plugin is valid.
  • With themeConfig.algolia omitted, the classic preset skips theme-search-algolia, so the swizzled src/theme/SearchPage (which calls useAlgoliaThemeConfig()) is never routed. The only other consumer, src/theme/SearchBar, is aliased to NullSearchBar. Nothing else in src/ reads the Algolia config.
  • The default path (flag unset) is unchanged: gtag, algolia, and the preconnect headTags are emitted exactly as before.
  • No workflow, KB copy, or products.js changes.

Optional nit: src/pages/index.js still emits the algolia-site-verification meta tag in private builds. It's harmless, but you could gate it if you want the staging output to have no Algolia references at all.

@jth-nw

jth-nw commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: the 1Secure Beta docs will live as an unlisted product in this repo instead (see #1850), so a private build flag is no longer needed.

@jth-nw jth-nw closed this Nov 9, 2026
@jth-nw
jth-nw deleted the feat/private-build-flag branch November 9, 2026 22:22

This branch was previously deployed

1 inactive deployment
development — 4684b28e Deployed Nov 9, 2026 by jth-nw via build-and-deploy #5096
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant