docs: replace localhost links in .md copies with production URLs

Draft
AL
20h ago
+4-2

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Description

This PR fixes RB-047 by replacing broken localhost:3000 links in markdown documentation files (.md copies) with production URLs.

Problem: Documentation pages served as .md files (e.g., https://reflex.dev/docs/getting-started/introduction.md) contained broken localhost:3000 links in their banners. These links were broken for external readers like AI agents, search engine crawlers, and ChatGPT, negatively impacting SEO and AEO (AI Engine Optimization).

Example of the broken banner:

> For AI agents: the complete documentation index is at [llms.txt](https://reflex.dev/docs/llms.txt). 
For a Markdown version, remove the trailing slash from the page URL and append `.md`. 
The docs home is available at [index.md](http://localhost:3000/docs/index.md).

Solution: Changed the markdown directive banner to use hardcoded production URLs (https://reflex.dev/docs/index.md) instead of config-dependent localhost URLs. This is consistent with how PUBLIC_LLMS_TXT_URL is already handled.

Changes:

  • Added PUBLIC_DOCS_HOME_MARKDOWN_URL constant pointing to production URL
  • Updated _markdown_directive() to use the new constant instead of public_url("/index.md")
  • Updated test expectations to match the production URL
  • Added news fragment for changelog

Impact

This is a template-level one-line fix that applies to all generated .md documentation files. No individual doc pages were modified.

Testing

  • Updated test passes successfully
  • Linting passes (ruff check and ruff format)
  • Verified no remaining localhost:3000 references in docs generation code
  • News fragment added

References

Fixes RB-047

Open in Web Open in Cursor