class Jekyll::Site

def load_theme_configuration(config)

def load_theme_configuration(config)
  return config if config["ignore_theme_config"] == true
  theme_config_file = in_theme_dir("_config.yml")
  return config unless File.exist?(theme_config_file)
  # Bail out if the theme_config_file is a symlink file irrespective of safe mode
  return config if File.symlink?(theme_config_file)
  theme_config = SafeYAML.load_file(theme_config_file)
  return config unless theme_config.is_a?(Hash)
  Jekyll.logger.info "Theme Config file:", theme_config_file
  # theme_config should not be overriding Jekyll's defaults
  theme_config.delete_if { |key, _| Configuration::DEFAULTS.key?(key) }
  # Override theme_config with existing config and return the result.
  # Additionally ensure we return a `Jekyll::Configuration` instance instead of a Hash.
  Utils.deep_merge_hashes(theme_config, config)
    .each_with_object(Jekyll::Configuration.new) do |(key, value), conf|
      conf[key] = value
    end
end