Sha256: 3b3197b868c41e4659c59ad2ea65ceeaff6dd4d8b4ffa83a2c15b517c9383159

Contents?: true

Size: 857 Bytes

Versions: 1

Compression:

Stored size: 857 Bytes

Contents

module Octopress
  module Configuration

    DEFAULTS = {
      'new_post_extension' => 'markdown',
      'new_page_extension' => 'html',
      'new_post_layout' => 'post',
      'new_page_layout' => 'page',
      'titlecase' => true
    }

    def self.config(options={})
      return @config if @config

      file = options['octopress-config'] || '_octopress.yml'
      config = {}
      if File.exist? file
        config = YAML.safe_load(File.open(file))
      end
      @config = DEFAULTS.deep_merge(config)
    end

    def self.jekyll_config(options={})
      return @jekyll_config if @jekyll_config

      log_level = Jekyll.logger.log_level
      Jekyll.logger.log_level = Jekyll::Stevenson::WARN
      jekyll_config = Jekyll.configuration(options)
      Jekyll.logger.log_level = log_level

      @jekyll_config = jekyll_config
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
octopress-3.0.0.alpha8 lib/octopress/configuration.rb