class Staticpress::Content::Theme
Public Class Methods
all()
click to toggle source
# File lib/staticpress/content/theme.rb, line 22 def self.all gather_resources_from Staticpress::Theme.theme.assets end
find_by_path(path)
click to toggle source
# File lib/staticpress/content/theme.rb, line 30 def self.find_by_path(path) if path.file? stubs = Staticpress::Route::REGEX_STUBS regex = /#{stubs[:theme].regex}\/assets\/#{stubs[:asset_type].regex}\/#{stubs[:slug].regex}/ # FIXME send parse_slug something more intelligent as second parameter if match = regex.match(parse_slug(path, Staticpress.root + 'themes').first) new hash_from_match_data(match) end end end
new(params)
click to toggle source
Calls superclass method
Staticpress::Content::Base::new
# File lib/staticpress/content/theme.rb, line 8 def initialize(params) super @template_types = find_supported_extensions template_path end
published()
click to toggle source
# File lib/staticpress/content/theme.rb, line 26 def self.published all end
Public Instance Methods
static?()
click to toggle source
# File lib/staticpress/content/theme.rb, line 13 def static? (Staticpress::Theme.new(params[:theme]).root + 'assets' + params[:asset_type] + params[:slug]).file? end
template_path()
click to toggle source
# File lib/staticpress/content/theme.rb, line 18 def template_path Staticpress::Theme.new(params[:theme]).root + 'assets' + params[:asset_type] + "#{params[:slug]}#{template_extension}" end