Jekyll
Learn how to deploy Jekyll static sites with Forge for optimal performance and ease of use.
Overview
Jekyll is a popular ruby-based static site generator (SSG) tool. You can continuously deploy your Jekyll sites to Forge.
Getting Started
Go to your Site Settings > Cloud Compilers and select Jekyll.
Now when you push to your GitHub repository, Forge will automatically run the Jekyll build process, before making your site ready for deployment to the global CDN.
Prerequisites
Before deploying a Jekyll site with Forge:
- Ensure you have a Jekyll project with a proper Gemfile
- Configure your Jekyll site for production builds
- Set up your _config.yml file correctly
- Test your site locally with
jekyll serve
Configuration
Configure your Jekyll site for Forge deployment:
Gemfile Configuration
Ensure your Gemfile includes:
source "https://rubygems.org"
gem "jekyll"
gem "webrick" # Required for Ruby 3.0+
Jekyll Configuration
Update your _config.yml for production:
# Site settings
title: Your Site Title
description: Your site description
# Build settings
destination: _site
plugins: []
# Production settings
url: "https://yoursite.getforge.io"
baseurl: ""
Build Settings
Unlike some other static site generators, Forge does not auto-detect Jekyll projects. You must manually specify Jekyll in your build settings:
- Navigate to your Site Settings
- Go to Cloud Compilers section
- Select Jekyll from the available options
- Configure your build command and output directory
Deployment Options
You can deploy Jekyll sites using:
- GitHub Sync: Connect your repository for automatic deployments
- Drag & Drop: Upload the built _site folder
- Forge CLI: Use the command line for deployments
Build Process
Once configured, Forge handles the Jekyll build process:
- Installs Ruby dependencies from Gemfile
- Runs
jekyll buildto generate static files - Deploys the contents of the _site directory
- Optimizes assets for production
- Deploys to the global CDN
Custom Build Commands
If you need custom build commands, create a build script:
#!/bin/bash
# Custom build script
bundle install
bundle exec jekyll build
# Additional build steps here
Performance Optimization
Optimize your Jekyll site for Forge:
- Use Jekyll's built-in asset optimization
- Enable gzip compression
- Optimize images and other assets
- Use CDN for static assets
- Minimize HTTP requests
Troubleshooting
Common Jekyll deployment issues:
- Build failures: Check your Gemfile and dependencies
- Missing plugins: Ensure plugins are in your Gemfile
- Configuration errors: Validate your _config.yml syntax
- Asset issues: Check file paths and references
Join the Discussion
Have questions or want to share your experience? Join our community discussion to connect with other developers and get help from the Forge team.
Visit Forum Discussion