Skip to content

fix: resolve dashboard image paths using Astro base URL#46

Merged
spboyer merged 1 commit into
mainfrom
squad/39-fix-dashboard-images
Mar 3, 2026
Merged

fix: resolve dashboard image paths using Astro base URL#46
spboyer merged 1 commit into
mainfrom
squad/39-fix-dashboard-images

Conversation

@spboyer

@spboyer spboyer commented Mar 3, 2026

Copy link
Copy Markdown
Member

Summary

Images on the dashboard-explore page were broken on the Azure Static Web Apps site (proud-beach-0e05cbe0f.2.azurestaticapps.net) because paths were hardcoded with /waza/ prefix, which only works on GitHub Pages.

Changes

  • ZoomImage.astro: Now resolves image paths using import.meta.env.BASE_URL at build time
  • dashboard-explore.mdx: Changed all 13 image refs from /waza/images/... to /images/... (root-relative)

How it works

  • On GitHub Pages (base = /waza): paths resolve to /waza/images/explore/...
  • On Azure SWA (base = /): paths resolve to /images/explore/...

Closes #39

Images were hardcoded with /waza/ prefix, which only works on GitHub
Pages. The Azure Static Web Apps site serves from / so images 404'd.

ZoomImage now prepends import.meta.env.BASE_URL at build time, and
mdx files use root-relative paths (/images/...) instead of hardcoded
/waza/images/... paths.

Closes #39

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 3, 2026 16:45
@github-actions github-actions Bot enabled auto-merge (squash) March 3, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes broken images on the dashboard-explore documentation page for Azure Static Web Apps deployments. Previously, image paths were hardcoded with a /waza/ prefix, which only worked for GitHub Pages. The fix makes image resolution environment-aware by centralizing the base URL logic in ZoomImage.astro and using root-relative paths in the MDX content.

Changes:

  • ZoomImage.astro now resolves image src paths using import.meta.env.BASE_URL at build time, stripping a trailing slash to avoid double-slash paths when BASE_URL="/".
  • All 13 image references in dashboard-explore.mdx were updated from /waza/images/... to /images/... (root-relative), delegating base-prefix resolution to ZoomImage.astro.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
site/src/components/ZoomImage.astro Adds BASE_URL-aware path resolution so images work on both GitHub Pages and Azure SWA
site/src/content/docs/guides/dashboard-explore.mdx Updates all 13 image references from hardcoded /waza/images/... to root-relative /images/...

@spboyer spboyer disabled auto-merge March 3, 2026 18:33
@spboyer spboyer enabled auto-merge (squash) March 3, 2026 18:34
@spboyer spboyer disabled auto-merge March 3, 2026 18:34
@spboyer spboyer merged commit dd43600 into main Mar 3, 2026
10 checks passed
@spboyer spboyer deleted the squad/39-fix-dashboard-images branch March 3, 2026 18:34
spboyer added a commit that referenced this pull request Mar 3, 2026
Images were hardcoded with /waza/ prefix, which only works on GitHub
Pages. The Azure Static Web Apps site serves from / so images 404'd.

ZoomImage now prepends import.meta.env.BASE_URL at build time, and
mdx files use root-relative paths (/images/...) instead of hardcoded
/waza/images/... paths.

Closes #39

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Images broken in dashboard page on gh-pages

2 participants