Sha256: 4b2bc9f4f9aade5597655d21808aafed7091d188750bffbf7be5648b9ef4a52b

Contents?: true

Size: 810 Bytes

Versions: 1

Compression:

Stored size: 810 Bytes

Contents

module Jekyll
  module Diagrams
    module Util
      class << self
        def diagrams_config(context)
          site_config = context.registers[:site].config
          new_config = site_config.fetch('jekyll-diagrams', {})   
          old_config = site_config.fetch('diagrams', {})
          
          return new_config if old_config.empty?
          
          Jekyll.warn "Configuration `diagram` in _config.yml will be depreated"
          Jekyll.warn "    Rename it to `jekyll-diagram` instead."

          old_config.merge(new_config)
        end
        
        def config_for(context, name)
          diagrams_config(context).fetch(name, {})
        end

        def vendor_path(file = '')
          File.join(File.expand_path('../../vendor', __dir__), file)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-diagrams-0.7.1 lib/jekyll-diagrams/util.rb