Skip to content

fix: GitHub Pages deployment - base path and CSS class attributes#5

Merged
pyros-projects merged 2 commits intomainfrom
fix/astro-css
Nov 24, 2025
Merged

fix: GitHub Pages deployment - base path and CSS class attributes#5
pyros-projects merged 2 commits intomainfrom
fix/astro-css

Conversation

@pyros-projects
Copy link
Copy Markdown
Owner

🐛 Critical Fix for GitHub Pages Deployment

Fixes two issues preventing the documentation site from rendering correctly on GitHub Pages.


🔍 Problems

1. Missing Base Path (Primary Issue)

Symptom: All assets (CSS, JS, images) returning 404 errors on GitHub Pages
Root Cause: Astro wasn't configured with the correct base path for GitHub Pages subdirectory deployment

Assets were trying to load from:

  • https://pyros-projects.github.io/_astro/index.css

Should load from:

  • https://pyros-projects.github.io/wishful/_astro/index.css

2. JSX vs HTML Syntax (Secondary Issue)

Symptom: Custom CSS classes not applied in production builds
Root Cause: Using className (JSX/React) instead of class (HTML) in MDX files


🔧 Changes

Modified Files

docs-site/astro.config.mjs

- site: 'https://wishful.local',
+ site: 'https://pyros-projects.github.io',
+ base: '/wishful',

Why: Configures Astro to prepend /wishful/ to all asset URLs for proper GitHub Pages routing

docs-site/src/content/docs/index.mdx

Changed all className="..." to class="..." (12 replacements)

Why: Astro/Starlight expects standard HTML attributes in production builds

pyproject.toml

- version = "0.2.2"
+ version = "0.2.3"

✅ Result

Before

  • 🚨 8 × 404 errors for CSS, JS, and image assets
  • 🎨 No custom styling (gradient backgrounds, pills, cards missing)
  • 📸 Plain unstyled HTML with default Starlight theme

After

  • ✅ All assets load correctly from /wishful/_astro/...
  • 🎨 Full custom styling with gradients, orange pills, card grid
  • 🌈 Beautiful branded theme matching theme.css

🧪 Verification

Used Playwright to identify 404 errors and path mismatches.


🎯 Impact

  • Breaking changes: None
  • Scope: Documentation site configuration only
  • Deployment: Fixes GitHub Pages immediately upon merge

Ready to merge and deploy! 🚀

@pyros-projects pyros-projects merged commit f77f7fb into main Nov 24, 2025
1 check passed
@pyros-projects pyros-projects deleted the fix/astro-css branch November 24, 2025 19:45
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