class Locomotive::Steam::Configuration

Attributes

adapter[RW]

Steam needs an adapter in order to fetch the site content (site itself, pages, content entries, …etc). By default, Steam is shipped with 2 adapters:

- Filesystem (options: path). the path option should point to the root path of the site
- MongoDB (options: database, hosts)

default: { name: :filesytem, path: nil }

asset_host[RW]

Enable serving of images, stylesheets, and JavaScripts from an asset server. Useful if a CDN is used to serve assets.

default: nil

asset_path[RW]

Path to the assets (if Steam serves the assets).

default: nil

csrf_protection[RW]

Enable the Cross-site request forgery protection for POST requests.

default: true

image_resizer_secret[RW]

Dragonfly needs it to generate the protective SHA.

default: 'please change it'

middleware[RW]

Manage the list of middlewares used by the rack stack.

Example:

Locomotive::Steam.configure do |config|
  ...
  config.middleware.remove Rack::Lint
  ...
  config.middleware.insert_after Middleware::Locale, MySlugMiddleware, answer: 42
  ...
end
minify_assets[RW]

If java is installed and if this option is enabled, then Uglifier and Sass are used to minify the javascript and the css.

default: false

mode[RW]

Mainly used in the liquid templates (variable name: {{ mode }}) to distinguish the page rendered in Wagon (:test) or in the Engine.

default: :production

moneta[RW]

Options for the store of Moneta (Session)

default: { store: Moneta.new(:Memory, expires: true) }

render_404_if_no_site[RW]

Render a 404 page if no site has been found. If Steam is embedded in another app, it's better to let the app handle the no site case.

default: true

serve_assets[RW]

Tell if Steam has to also serve static (images) or dynamic (SASS, Coffeescript) assets.

default: true

services_hook[RW]

Lambda called once a Services instance has been built. It is used when we want to change one of the services

Example:

Locomotive::Steam.configure do |config|

config.services_hook = -> (services) {
  require 'my_custom_site_finder'
  services.site_finder = MyCustomSiteFinder.new
}

end

default: nil

theme_assets_checksum[RW]

Add the checksum of a theme asset at the end of its path to allow public caching.

default: false (disabled)