Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Transform your Jekyll app into Rack application!
Rack-Jekyll is an open-source Ruby gem that turns a Jekyll static site into a Rack application, so you can serve it with any Rack-compatible web server. It takes your Jekyll project (with its _config.yml and _site output) and exposes it through a config.ru interface, returning static files as the HTTP response. The gem is maintained by a list of contributors on GitHub, including Adão Raul, Gonzalo Rodríguez-Baltanás Díaz, Scott Watermasysk, and others.
Rack-Jekyll is a lightweight adapter that wraps Jekyll's static output into a Rack app. You add two lines to config.ru (require "rack/jekyll" and run Rack::Jekyll.new), and then any Rack server can serve your Jekyll site. It reads Jekyll configuration from _config.yml and supports overrides via initialization options.
jekyll serve._site because Heroku's filesystem is read-only.:destination option, e.g. Rack::Jekyll.new(:destination => "mysite"), to output the site to a custom directory instead of the default _site._config.yml or accepts initialization options such as :config, :force_build, :auto, and :wait_page.404.html with YAML front matter from the root directory.:force_build forces site generation at startup even when the destination already exists; :auto enables watch mode to rebuild on file changes.config.ru.config.ru, run jekyll build, add gem "rack-jekyll" to your Gemfile, then git add ., git commit, heroku create, and git push heroku master — to host your site.rackup, shotgun, or unicorn locally to get server-specific features like live reloading.:destination option, useful for sites that need an unusual build location.:wait_page to an HTML file so visitors see a branded hold page while Jekyll generates the site, with a meta refresh to automatically load the finished site.Create a config.ru in your Jekyll site's root with require "rack/jekyll" and run Rack::Jekyll.new. When a request comes in, Rack-Jekyll serves the generated static files from the destination directory. If the destination is empty or :force_build is true, it builds the site on startup. For Heroku, you must build locally and commit _site beforehand, since the platform does not allow writes at runtime.
Yes. The README provides an exact list of steps: add a config.ru, build pages with jekyll build, add gem "rack-jekyll" to your Gemfile, then git init, git add ., git commit, heroku create, and git push heroku master. Because Heroku's filesystem is read-only, do not set the :force_build option to true.
Yes. Rack-Jekyll reads settings from a _config.yml file by default. You can also pass overrides directly in config.ru, such as :destination => "mysite", or use the :config option to point at a different config file.
The :wait_page initialization option specifies an HTML file relative to the Jekyll root that is served while Jekyll is rendering the site. The page should be self-contained (no external CSS or JS) and can include a meta refresh tag with a 60-second interval so it eventually loads the finished site.
Yes. Place a 404.html file with YAML front matter in your site's root directory, and Rack-Jekyll will serve it whenever a visitor requests a non-existent path.
Rack-Jekyll is an open-source Ruby gem hosted on GitHub. The repository lists contributors and invites pull requests, indicating it is free to use under an open-source license.
