Deploy Jekyll with Bantam CLI
Transform plain text into static websites and blogs
Quick start:
# Build your Jekyll app
bundle exec jekyll build
# Deploy it
bantam deploy _site
Quick Start
Install dependencies
Install Jekyll and gem dependencies
bundle install
Build your site
Generate static HTML from your content
bundle exec jekyll build
Deploy with Bantam
Your Jekyll site is now live!
bantam deploy _site
Framework Details
Jekyll Configuration
Configure Jekyll for production builds:
_config.yml:
# Site settings
title: My Jekyll Site
url: "https://mysite.bantam.host"
baseurl: ""
# Build settings
markdown: kramdown
plugins:
- jekyll-feed
- jekyll-sitemap
- jekyll-seo-tag
# Exclude files from build
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor
Environment-Specific Builds
Build for different environments:
Production build:
# Production build with optimizations
JEKYLL_ENV=production bundle exec jekyll build
# Development build with drafts
bundle exec jekyll build --drafts
Use environment in templates:
{% if jekyll.environment == "production" %}
<script src="analytics.js"></script>
{% endif %}
Build Output
Jekyll generates static files in the _site
directory:
index.html
- Homepageabout/index.html
- Static pages2024/01/post-title/index.html
- Blog postsfeed.xml
- RSS feedsitemap.xml
- SEO sitemapassets/
- CSS, JS, and images
Advanced Usage
Custom Domain
Deploy directly to your own domain
bantam deploy ./dist --domain myapp.com
Permanent Deployment
Keep your site online forever (requires login)
bantam deploy ./dist --permanent
Custom Expiry
Set how long your deployment stays online
bantam deploy ./dist --expiry-days 7
Custom Subdomain
Choose your own subdomain on bantam.site
bantam deploy ./dist --subdomain my-project
CI/CD Integration
Add Bantam to your continuous deployment pipeline:
# GitHub Actions example
- name: Deploy to Bantam
run: |
npm install -g @bantamhq/cli
bantam login --token ${{ secrets.BANTAM_TOKEN }}
bantam deploy ./dist --domain myapp.com --permanent
Common Issues & Solutions
Quick fixes for deployment challenges
01.Bundler version conflicts?
Update bundler and clear cache:
gem update bundler
bundle update --bundler
rm -rf vendor/bundle
bundle install
02.Liquid syntax errors?
Debug with strict mode:
# _config.yml
liquid:
error_mode: strict
strict_filters: true
Common issue - escape liquid in code blocks:
{% raw %}
{{ "{{ variable " }}}}
{% endraw %}
03.Plugins not working in production?
Ensure plugins are in your Gemfile:
# Gemfile
source "https://rubygems.org"
gem "jekyll", "~> 4.3"
group :jekyll_plugins do
gem "jekyll-feed"
gem "jekyll-sitemap"
gem "jekyll-seo-tag"
end
04.Assets not loading with correct paths?
Use Jekyll's URL filters:
<!-- Correct way -->
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
<img src="{{ '/assets/images/logo.png' | absolute_url }}" alt="Logo">
<!-- Wrong way -->
<link rel="stylesheet" href="/assets/css/style.css">
05.Build taking too long?
Enable incremental builds and caching:
# _config.yml
incremental: true
# Command line
bundle exec jekyll build --incremental
# Exclude large directories
exclude:
- node_modules
- .sass-cache
- .jekyll-cache