Troubleshooting: Deployed Site Looks Bad
Common Issues and Fixes
1. CSS/JavaScript Not Loading
Symptoms: Site appears unstyled, no colors, broken layout
Possible Causes:
- Asset paths are incorrect
- Files not committed to repository
- GitHub Pages build failed
- Browser cache issues
Solutions:
- Verify files are committed:
1 2 3 4
git status git add assets/ git commit -m "Add assets" git push
- Check GitHub Pages build:
- Go to repository → Actions tab
- Check if build succeeded
- Look for any errors
- Clear browser cache:
- Hard refresh:
Cmd+Shift+R(Mac) orCtrl+Shift+R(Windows) - Or open in incognito/private mode
- Hard refresh:
- Verify asset paths in HTML:
- View page source on deployed site
- Check if CSS/JS links are correct
- Should be:
/assets/css/main.cssorhttps://koffeeandkode.com/assets/css/main.css
2. Layout Broken
Symptoms: Content not centered, navigation broken, footer misaligned
Check:
- Container divs are present in layouts
- CSS is loading (see issue #1)
- No JavaScript errors in console
3. Dark Mode Not Working
Symptoms: Theme toggle doesn’t work
Check:
- JavaScript file is loading
- Browser console for errors
- LocalStorage is enabled
4. Code Blocks Not Highlighted
Symptoms: Code blocks appear plain text
Check:
- Syntax CSS is loading
- Rouge highlighter is configured in
_config.yml - Code blocks use proper markdown syntax
Quick Fixes
Force Rebuild on GitHub Pages
- Make a small change (add a space to
_config.yml) - Commit and push
- Wait for GitHub Pages to rebuild (check Actions tab)
Verify Asset Paths
The current setup uses:
/assets/css/main.cssfor local development- Should work on GitHub Pages with
baseurl: ""
If issues persist, try:
1
/assets/css/main.css
Check Build Output
- Build locally:
bundle exec jekyll build - Check
_site/assets/folder exists - Verify files are correct
Still Not Working?
- Check browser console (F12 → Console tab):
- Look for 404 errors
- Check for JavaScript errors
- Check network tab (F12 → Network tab):
- See if CSS/JS files are loading
- Check response codes (should be 200)
- Verify repository structure:
- Assets folder should be at root:
/assets/ - Not in
_assets/or elsewhere
- Assets folder should be at root:
- Check GitHub Pages settings:
- Repository → Settings → Pages
- Source should be “Deploy from a branch”
- Branch should be
mainormaster - Folder should be
/ (root)
Testing Locally vs Deployed
To test if it’s a deployment issue:
- Build locally:
bundle exec jekyll build - Serve the
_sitefolder:cd _site && python3 -m http.server 8000 - Visit
http://localhost:8000 - Compare with deployed version
If local _site works but deployed doesn’t:
- Likely a GitHub Pages configuration issue
- Check Actions tab for build errors