Local vs Deployed Version Differences
Key Differences
1. Jekyll Version
- Local: Jekyll 3.9 (due to Ruby 2.6.10 compatibility)
- GitHub Pages: Uses Jekyll 3.9 (as of 2024) - âś… Compatible
2. Base URL
- Local:
baseurl: ""(empty, served at root) - GitHub Pages:
- If using
koffeeandkode.com(user/organization page):baseurl: ""âś… - If using project page:
baseurl: "/koffeeandkode"(would need update)
- If using
3. URL Configuration
- Local:
http://localhost:4000 - Deployed:
https://koffeeandkode.com
4. Asset Paths
- Local: Assets resolve correctly with
baseurl: "" - Deployed: Should work the same, but verify asset paths use
/assets/...
5. Plugins
All plugins used are GitHub Pages compatible:
- âś…
jekyll-feed - âś…
jekyll-sitemap - âś…
jekyll-seo-tag - âś…
jekyll-redirect-from - âś…
jekyll-relative-links
6. Build Process
- Local:
bundle exec jekyll serve(development mode with auto-reload) - GitHub Pages: Automatic build on push (production mode, optimized)
Potential Issues to Watch For
1. Relative URLs
All asset references should use Jekyll’s relative_url filter:
1
/assets/css/main.css
âś… Already implemented in layouts
2. Collections
The _prototypes collection is configured correctly:
1
2
3
4
collections:
prototypes:
output: true
permalink: /prototypes/:name/
âś… Should work on GitHub Pages
3. Syntax Highlighting
Using rouge highlighter which is GitHub Pages compatible:
1
highlighter: rouge
âś… Compatible
4. Markdown Parser
Using kramdown with GFM parser:
1
markdown: kramdown
âś… Compatible (GFM parser included in Gemfile)
Testing Before Deployment
- Build locally in production mode:
1
bundle exec jekyll buildCheck
_site/folder for any errors - Test asset paths:
- Verify CSS loads correctly
- Check JavaScript files
- Test images (if any)
- Check for absolute URLs:
- Search for hardcoded
http://localhost:4000 - Ensure all links use
relative_urlorabsolute_urlfilters
- Search for hardcoded
After Deployment
- Verify the site loads:
https://koffeeandkode.com - Check console for errors: Open browser DevTools
- Test navigation: All links should work
- Verify dark mode: Theme toggle should work
- Test code copy buttons: JavaScript should function
- Check RSS feed:
https://koffeeandkode.com/feed.xml - Verify sitemap:
https://koffeeandkode.com/sitemap.xml
If Issues Occur
Common Problems:
- 404 errors on assets:
- Check
baseurlis correct - Verify asset paths use
relative_url
- Check
- JavaScript not working:
- Check browser console for errors
- Verify file paths are correct
- Styling looks different:
- Clear browser cache
- Check if CSS files are loading
- Collections not showing:
- Verify collection is in
_config.yml - Check file naming in
_prototypes/
- Verify collection is in
GitHub Pages Build Logs
If something doesn’t work:
- Go to repository → Actions tab
- Check the “pages build and deployment” workflow
- Look for build errors or warnings