Sha256: f8db11a2685577a008c8dd2641fa34996e86f787b3aba2270df66b3543099506

Contents?: true

Size: 716 Bytes

Versions: 3

Compression:

Stored size: 716 Bytes

Contents

# Render the config/base/index.html when precompiling.  Here we only render
# one js and one css file.

module Volt
  class BaseIndexRenderer
    def initialize(manifest)
      @manifest = manifest
    end

    def html
      index_path = File.expand_path(File.join(Volt.root, 'config/base/index.html'))
      html       = File.read(index_path)

      ERB.new(html, nil, '-').result(binding)
    end

    # When writing the index, we render the
    def javascript_tags
      "<script src=\"/assets/#{@manifest['assets']['main/app.js']}\"></script>"
    end

    def css_tags
      "<link href=\"/assets/#{@manifest['assets']['main/app.css']}\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
volt-0.9.5.pre7 lib/volt/cli/base_index_renderer.rb
volt-0.9.5.pre6 lib/volt/cli/base_index_renderer.rb
volt-0.9.5.pre5 lib/volt/cli/base_index_renderer.rb