module Jekyll
def self.configuration(override)
list of option names and their defaults.
the defaults and the config file. See Jekyll::Configuration::DEFAULTS for a
override - A Hash of config directives that override any options in both
options with anything in _config.yml, and adding the given options on top.
Public: Generate a Jekyll configuration Hash by merging the default
def self.configuration(override) config = Configuration[Configuration::DEFAULTS] override = Configuration[override].stringify_keys config = config.read_config_files(config.config_files(override)) # Merge DEFAULTS < _config.yml < override config = Utils.deep_merge_hashes(config, override).stringify_keys set_timezone(config['timezone']) if config['timezone'] config end
def self.env
def self.env ENV["JEKYLL_ENV"] || "development" end
def self.fs_root
Public: File system root
def self.fs_root @fs_root ||= "/" end
def self.logger
def self.logger @logger ||= LogAdapter.new(Stevenson.new) end
def self.logger=(writer)
def self.logger=(writer) @logger = LogAdapter.new(writer) end
def self.sanitized_path(base_directory, questionable_path)
def self.sanitized_path(base_directory, questionable_path) clean_path = File.expand_path(questionable_path, fs_root) clean_path.gsub!(/\A\w\:\//, '/') unless clean_path.start_with?(base_directory) File.join(base_directory, clean_path) else clean_path end end
def self.set_timezone(timezone)
timezone - the IANA Time Zone
Static: Set the TZ environment variable to use the timezone specified
def self.set_timezone(timezone) ENV['TZ'] = timezone end