Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Summary

Documents the substitute-env-vars setting in docs.yml that allows users to inject environment variables into their documentation content at build time. This feature already exists in the Fern CLI but was not documented.

Changes:

  • Added settings.substitute-env-vars documentation to the Settings configuration section in site-level-settings.mdx
  • Added the setting to the example code block
  • Created a changelog entry for the feature

The documentation covers:

  • How to enable the feature (substitute-env-vars: true)
  • The ${VAR_NAME} syntax for referencing environment variables
  • How to escape literal ${VAR} using \$\{VAR\}
  • Where substitution applies (Markdown/MDX, API specs) and doesn't apply (JS files)
  • Behavior differences between preview (empty string) and publish (fails on undefined)

Review & Testing Checklist for Human

  • Verify the escape syntax \$\{VAR\} is correct by testing in a docs project
  • Check that the anchor link /learn/docs/configuration/site-level-settings#settingssubstitute-env-vars works in the preview
  • Confirm the preview vs publish behavior description is accurate (preview replaces undefined vars with empty strings, publish fails)

Suggested test plan: Enable substitute-env-vars: true in a test docs project, add ${TEST_VAR} to a page, and verify it substitutes correctly during fern docs dev and fern generate --docs.

Notes

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

🌿 Preview your docs: https://fern-preview-f1917b5e-938a-4d87-990b-5eaf4818dbae.docs.buildwithfern.com/learn

Visual changes detected:

fern/products/docs/pages/customization/site-level-settings.mdx

Page: learn/docs/configuration/site-level-settings | Change: 76.4036448684698%

Comparison image available in workflow artifacts

@chdeskur chdeskur merged commit ca9f40f into main Feb 3, 2026
2 checks passed
@chdeskur chdeskur deleted the devin/1770134408-document-env-vars branch February 3, 2026 16:37
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