Configuration

Set Perron's global configuration in config/initializers/perron.rb.

This file is automatically created with bin/rails generate perron:install.

It looks something like this:

Perron.configure do |config|
  config.site_name = "Perron"

  # Enable Live Reload with DOM Morphing in development
  # config.live_reload = true

  config.default_url_options = {host: "perron.railsdesigner.com", protocol: "https", trailing_slash: true}
end

All settings

Below are available settings:

  • site_name; used as fallback for meta tags
  • site_description; used as fallback for meta tags
  • output; location for site build, defaults to /output/
  • mode; :standalone or :integrated, defaults to standalone
  • live_reload; automatically reload the page on changes (uses the Mata gem)
  • additional_routes: array of route helper names to include in the build beyond collections (e.g., %w[root_path robots_path]). Defaults to %w[root_path] in :standalone mode and [] in :integrated mode
  • allowed_extensions; set which extensions for content files are allowed, defaults to %w[erb md]
  • exclude_from_public; exclude directories with compiled files should be excluded from public, defaults to %w[assets storage]
  • excluded_assets; exclude which assets shoud be excluded when compiling, defaults to %w[action_cable actioncable actiontext activestorage rails-ujs trix turbo]
  • view_unpublished; option to show unpublished content content, defaults to Rails.env.development?
  • default_url_options; set options for route helpers
  • markdown_parser; specifiy custom markdown parser
  • markdown_options; pass options to the installed markdown gem
  • sitemap.enabled; enable creation of the sitemap.xml, defaults to false
  • sitemap.priority; default priority for sitemap items, defaults to 0.5
  • sitemap.change_frequency; defaults to :monthly