module Serum
Constants
- DEFAULTS
Default options. Strings rather than symbols are used for compatability with YAML.
- VERSION
Public Class Methods
configuration(override)
click to toggle source
Public: Generate a Serum
configuration Hash
by merging the default options with anything in _config.yml, and adding the given options on top.
override - A Hash
of config directives that override any options in both
the defaults and the config file. See Serum::DEFAULTS for a list of option names and their defaults.
Returns the final configuration Hash
.
# File lib/serum.rb, line 53 def self.configuration(override) # Convert any symbol keys to strings and remove the old key/values override = override.reduce({}) { |hsh,(k,v)| hsh.merge(k.to_s => v) } # Merge DEFAULTS < override Serum::DEFAULTS.deep_merge(override) end
for_dir(source, opts={})
click to toggle source
Public: Generate a new Serum::Site
for the given directory.
source - A String
path to the directory. opts - A Hash
of additional configuration options.
Returns the Serum::Site
.
# File lib/serum.rb, line 67 def self.for_dir(source, opts={}) Serum::Site.new(configuration({source: source}.merge(opts))) end