Module: Pullentity::Client::MiddlemanConfig

Defined in:
lib/pullentity-client/helpers.rb

Class Method Summary collapse

Class Method Details

.locationObject



95
96
97
# File 'lib/pullentity-client/helpers.rb', line 95

def location
  @location ||= Pathname.new(Dir.pwd)
end

.registered(app) ⇒ Object Also known as: included



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/pullentity-client/helpers.rb', line 56

def registered(app)
  app.helpers Pullentity::Client::Helpers
  app.set :site_name, site_name
  app.set :theme_name, theme_name
  app.set :sass_assets_paths, []
  app.set :relative_links, false
  app.set :images_dir,  "assets/images"
  app.set :fonts_dir,  "assets/fonts"
  app.set :css_dir,  "assets/stylesheets"
  app.set :js_dir, "assets/javascripts"
  app.set :markdown, :layout_engine => :haml
  app.set :default_encoding, 'utf-8'

  app.configure :build do
    if target?(:pullentity)
      activate :minify_css
      activate :minify_javascript
      app.set :http_prefix, "#{URL_REMOTE}"
      app.set :images_dir,  "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets"
    end
  end

  app.use Rack::Rewrite do
    r301 %r{/sections(.*)}, '/'
    r301 %r{/projects(.*)}, '/'
  end

end

.site_nameObject



85
86
87
88
# File 'lib/pullentity-client/helpers.rb', line 85

def site_name
  hsh = YAML.load_file(location + "pullentity.yml")
  hsh["site"]
end

.theme_nameObject



90
91
92
93
# File 'lib/pullentity-client/helpers.rb', line 90

def theme_name
  hsh = YAML.load_file(location + "pullentity.yml")
  hsh["theme_name"]
end