Sha256: cfdebe2e0302430e95252799766ffe5d60345d3bd3aade172fb3917507cceee4

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

require "middleman"
require 'middleman-target'

module Pullentity::Client::Helpers

    def javascript_include_tag(file)
      if target?(:pullentity)
        path = "/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}"
        "<link href='#{path}.css' media='screen' rel='stylesheet' type='text/css' />"
      else
        super
      end
    end

    def test_data_include_tag
      unless target?(:pullentity)
        javascript_include_tag "test-data"
      end
   end
    def site_name
      hsh = YAML.load_file(location + "pullentity.yml")
      hsh["site"]
    end

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

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

    def asset_pathxxxx(file)
      if target?(:pullentity)
        'yea'
      else
        super
      end
    end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pullentity-client-0.0.8 lib/pullentity-client/helpers.rb