fix: resolve dashboard image paths using Astro base URL#46
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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.astronow resolves imagesrcpaths usingimport.meta.env.BASE_URLat build time, stripping a trailing slash to avoid double-slash paths whenBASE_URL="/".- All 13 image references in
dashboard-explore.mdxwere updated from/waza/images/...to/images/...(root-relative), delegating base-prefix resolution toZoomImage.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
added a commit
that referenced
this pull request
Mar 3, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
import.meta.env.BASE_URLat build time/waza/images/...to/images/...(root-relative)How it works
/waza): paths resolve to/waza/images/explore/...✅/): paths resolve to/images/explore/...✅Closes #39