Class: Skyline::Configuration

Inherits:
Configure
  • Object
show all
Defined in:
lib/skyline/configuration.rb

Overview

TODO:

This configuration class will someday change as it’s not flexible enough for our purposes.

Contains the default skyline configuration. Currently this is also the place to look for available configuration options.

Instance Method Summary collapse

Instance Method Details

#after_configureObject



102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/skyline/configuration.rb', line 102

def after_configure
  sanitize_paths
  
  Skyline::MediaNode.assets_path = self["assets_path"]  
  Skyline::MediaCache.cache_path = self["media_file_cache_path"]
  
  if self.sections.values.flatten.uniq.include?("rss_section")
    Skyline::Sections::RssSection.cache_path = self["rss_section_cache_path"]
    Skyline::Sections::RssSection.cache_timeout = self["rss_section_cache_timeout"]
  end
  
  Skyline::Rendering::Renderer.register_renderables(:sections,self["sections"])
  Skyline::Rendering::Renderer.register_renderables(:articles,self["articles"] + ["Skyline::Page"])      
end

#articlesObject



117
118
119
# File 'lib/skyline/configuration.rb', line 117

def articles
  self["articles"].map(&:constantize)
end

#content_classesObject



121
122
123
# File 'lib/skyline/configuration.rb', line 121

def content_classes
  self["content_classes"].map(&:constantize)
end

#url_prefixObject



125
126
127
# File 'lib/skyline/configuration.rb', line 125

def url_prefix
  self["url_prefix"].gsub(/\A\//, "")
end