Snowlake Jekyll documentation
Deploy to Cloudflare Pages
Publish Snowlake on Cloudflare Pages from a GitHub or GitLab repository: build settings, environment variables, custom domain and fixes for common build errors.
Overview
Cloudflare Pages builds Snowlake straight from your Git repository and republishes it every time you push. It is free for most sites, and the repository can be private.
All build settings live in the Cloudflare dashboard, so the theme needs no Cloudflare config file. If you have a cloudflare.toml from Snowlake 2.0 or older, you can delete it: Cloudflare Pages never reads it.
Before you start
- Set your site address in
_config.yml:
Use your own domain, or thebaseurl: "" url: "https://your-domain.com"*.pages.devaddress Cloudflare gives you after the first deploy. Leavebaseurlempty: Cloudflare serves the site from the root of the domain. - Push the theme to a GitHub or GitLab repository. Include the
Gemfile;Gemfile.lockis optional.
Create the project
- In the Cloudflare dashboard, open Workers & Pages and choose Create.
- Choose Pages, then connect your GitHub or GitLab account and select your repository.
- Enter these build settings:
| Setting | Value |
|---|---|
| Production branch | main |
| Framework preset | Jekyll |
| Build command | bundle exec jekyll build |
| Build output directory | _site |
- Under Environment variables, add:
| Variable | Value | Why |
|---|---|---|
JEKYLL_ENV |
production |
Turns on production output, such as the Google Analytics tag |
RUBY_VERSION |
3.4.4 |
Optional. Pins the Ruby version Snowlake was tested with, so a future Cloudflare default can’t change it |
- Choose Save and Deploy. Cloudflare installs the gems from your
Gemfileautomatically, builds the site and gives you a*.pages.devaddress. The first build takes a few minutes; later builds are faster.
Add your domain
Open your project, go to Custom domains and add your domain. If you change the address, update url in _config.yml to match and push again, so share links and preview images use the right address.
Preview deployments
Every branch you push gets its own preview address. To include draft and future-dated posts in previews only, set a different build command for the Preview environment:
bundle exec jekyll build --drafts --future
Troubleshooting
cannot load such file -- csv or wdm fails to install. Your Gemfile is from Snowlake 1.1 or older, which predates Ruby 3.4. Copy the Gemfile from the latest Snowlake download and push again.
Pages have no styles or images. Check that baseurl in _config.yml is empty ("").
Share links point to the demo site. Set url in _config.yml to your own domain.
Google Analytics shows no visits. Check that JEKYLL_ENV is set to production and that google_analytics.enable is true in _data/general_settings.yml.