Skip to main content

Cloudflare Pages

to run in your site's root directory
View template source
gem "perron" unless File.read("Gemfile").include?("perron")

after_bundle do
  unless File.exist?("config/initializers/perron.rb")
    rails_command "perron:install"
  end

create_file "wrangler.toml", <<~TOML
  name = "my-perron-site"
  pages_build_output_dir = "./output"

  [vars]
    RAILS_ENV = "production"
    RUBY_VERSION = "3.4.5"
    PERRON_HOST = "yourdomain.com"
    PERRON_PROTOCOL = "https"
TOML

end

This snippet adds a configuration file for Cloudflare Pages deployments. The wrangler.toml file defines your project name, build output directory and configures environment variables for your Perron-powered static site.