class Site

Public Instance Methods

in_source_dir(*paths) click to toggle source

First try to find the file referenced in the jekyll folder (by default _config.yml), in case is not there, then try to find it in the mrhyde folder (by default _config.yml)

# File lib/mr_hyde/jekyll_ext/site.rb, line 11
def in_source_dir(*paths)
  file_path = paths.reduce(source) do |base, path|
    Jekyll.sanitized_path(base, path)
  end
  unless File.exist? file_path
    file_path = paths.reduce(MrHyde.source) do |base, path|
      Jekyll.sanitized_path(base, path)
    end
  end
  file_path
end
pristine_site_payload()
Alias for: site_payload
site_payload() click to toggle source

This patching ensures that if the site is the main, then adds to the payload the sites value containing the sites payloads info within sources sites.

# File lib/mr_hyde/jekyll_ext/site.rb, line 26
def site_payload
  payload = pristine_site_payload

  if source == MrHyde.main_site
    site_names = MrHyde.built_list

    unless site_names.empty?
      sites_payload = site_names.map do |site_name|
        opts = MrHyde.site_configuration(site_name)
        opts['quiet'] = true
        opts = Jekyll.configuration(opts)
        site = Site.new opts

        Utils.deep_merge_hashes site.site_payload['site'], { 'name' => site_name }
      end
      payload['site'] = Utils.deep_merge_hashes(payload['site'], { 'sites' => sites_payload })
    end
  end

  payload
end
Also aliased as: pristine_site_payload