lib/pullentity-client/helpers.rb in pullentity-client-0.0.9 vs lib/pullentity-client/helpers.rb in pullentity-client-0.1.0

- old
+ new

@@ -1,22 +1,24 @@ require "middleman" require 'middleman-target' +URL_REMOTE = "http://pullentity.s3.amazonaws.com" module Pullentity::Client::Helpers + def javascript_include_tag(file) if target?(:pullentity) - path = "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}" + path = "#{URL_REMOTE}/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}" "<script src='#{path}.js' type='text/javascript'></script>" else super end end def stylesheet_link_tag(file) if target?(:pullentity) - path = "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}" + path = "#{URL_REMOTE}/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}" "<link href='#{path}.css' media='screen' rel='stylesheet' type='text/css' />" else super end end @@ -56,13 +58,24 @@ class << self 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.compass_config do |config| # config is the Compass.configuration object config.output_style = :compact - config.http_images_path = "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets" + if target?(:pullentity) + config.http_images_path = "#{URL_REMOTE}/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets" + end end end def site_name hsh = YAML.load_file(location + "pullentity.yml") \ No newline at end of file