class Locomotive::Steam::Configuration
Attributes
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 }
Enable serving of images, stylesheets, and JavaScripts from an asset server. Useful if a CDN is used to serve assets.
default: nil
Path to the assets (if Steam
serves the assets).
default: nil
Enable the Cross-site request forgery protection for POST requests.
default: true
Dragonfly needs it to generate the protective SHA.
default: 'please change it'
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
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
Mainly used in the liquid templates (variable name: {{ mode }}) to distinguish the page rendered in Wagon (:test) or in the Engine.
default: :production
Options for the store of Moneta (Session)
default: { store: Moneta.new(:Memory, expires: true) }
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
Tell if Steam
has to also serve static (images) or dynamic (SASS, Coffeescript) assets.
default: true
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
Add the checksum of a theme asset at the end of its path to allow public caching.
default: false (disabled)