bantam.hostbantam.host
CLI Guide

Deploy Jekyll with Bantam CLI

Transform plain text into static websites and blogs

Install Bantam CLI:

npm install -g @bantamhq/cli

View on NPM: @bantamhq/cli

Quick start:

# Build your Jekyll app
bundle exec jekyll build

# Deploy it
bantam deploy _site

Quick Start

1

Install dependencies

Install Jekyll and gem dependencies

bundle install
2

Build your site

Generate static HTML from your content

bundle exec jekyll build
Creates the _site directory with your static files
3

Deploy with Bantam

Your Jekyll site is now live!

bantam deploy _site
Get an instant URL like https://my-jekyll-site-abc123.bantam.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
Set your production URL for proper canonical URLs and sitemap generation.

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 - Homepage
  • about/index.html - Static pages
  • 2024/01/post-title/index.html - Blog posts
  • feed.xml - RSS feed
  • sitemap.xml - SEO sitemap
  • assets/ - CSS, JS, and images
Jekyll creates clean URLs by default using directory structure.

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
Troubleshooting

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