Skip to content

Fix hardcoded base URLs so PR previews load assets correctly#120

Merged
AdamGohs merged 1 commit into
mainfrom
fix/hardcoded-baseurl-paths
May 20, 2026
Merged

Fix hardcoded base URLs so PR previews load assets correctly#120
AdamGohs merged 1 commit into
mainfrom
fix/hardcoded-baseurl-paths

Conversation

@AdamGohs
Copy link
Copy Markdown
Collaborator

Summary

  • Replaced hardcoded /RMC-Software-Documentation/ paths in 15 components, 13 landing pages, and the analytics client module with useBaseUrl() (React) and siteConfig.baseUrl from @generated/docusaurus.config (client module).
  • PR preview builds now resolve figure/video sources, counter JSON, version metadata, and bibliography paths against the active baseUrl (/RMC-Software-Documentation-Previews/pr-N/) instead of the production prefix — fixing broken figures, missing caption numbers, and unresolved figure/table/equation/citation references on previews.
  • Verified with both a default production build and a preview-style build (DOCUSAURUS_BASE_URL=/RMC-Software-Documentation-Previews/pr-test/); the built HTML emits correctly-prefixed asset URLs in both environments.

…tibility

Components and pages hardcoded /RMC-Software-Documentation/ for figure/video src
paths, counter JSON fetches, bibliography lookups, and version metadata. Under PR
preview builds the active baseUrl differs, so those requests resolved against the
production deploy instead — breaking new figures, captions, cross-references, and
citations on preview builds.

React components and pages now use useBaseUrl(); the analyticsEvents client module
uses siteConfig.baseUrl from @generated/docusaurus.config.
@AdamGohs AdamGohs requested a review from a team as a code owner May 20, 2026 02:14
@github-actions
Copy link
Copy Markdown

CI build passed for commit 309f603

This PR does not touch documentation content under docs/, so no multi-stage review is required.

@usace-rmc/docs-admin may merge.

@github-actions
Copy link
Copy Markdown

📄 Preview deployed for commit 309f603

https://usace-rmc.github.io/RMC-Software-Documentation-Previews/pr-120/

This preview updates automatically when new commits are pushed. Deleted when the PR closes.

@AdamGohs AdamGohs merged commit 7b12914 into main May 20, 2026
5 checks passed
@AdamGohs AdamGohs deleted the fix/hardcoded-baseurl-paths branch May 20, 2026 02:22
AdamGohs added a commit that referenced this pull request May 20, 2026
Resolves a conflict in src/pages/desktop-applications/lifesim.js by adopting
main's centralized docConfig pattern from PR #117. Flipped the LifeSim
Applications Guide entry in src/docConfig.js to active:true so the doc renders
on the PR-116 preview during review (previously encoded inline as active:true
on this branch).

Brings in the baseUrl fix from PR #120 so figures, captions, and references
on the preview resolve against the preview baseUrl instead of production.
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