module AssetPages::Util
Public Class Methods
fetch_nested(hash, *keys)
click to toggle source
# File lib/asset_pages/util.rb, line 41 def self.fetch_nested(hash, *keys) keys.reduce(hash) do |hash, key| if hash.respond_to?(:[]) hash[key] else nil end end end
find_yaml_configs()
click to toggle source
# File lib/asset_pages/util.rb, line 21 def self.find_yaml_configs root = ::Rails.application.root configs = [] default_config = root + "_config.yml" configs.push(default_config) \ if default_config.file? configs += (root + "config/jekyll").children.select do |pathname| pathname.file? && pathname.extname == ".yml" end configs end
jekyll_config()
click to toggle source
# File lib/asset_pages/util.rb, line 37 def self.jekyll_config ::Jekyll.configuration(config: find_yaml_configs) end