Sha256: d7c984f219315668cef931483ed39be557f858e10f68977eb622b055820c7a76

Contents?: true

Size: 748 Bytes

Versions: 7

Compression:

Stored size: 748 Bytes

Contents

# frozen_string_literal: true

module Archangel
  module Liquid
    module Tags
      ##
      # Theme Javascript custom tag for Liquid
      #
      # Example
      #   {% theme_javascript %}
      #
      class ThemeJavascriptTag < ApplicationTag
        ##
        # Render the Javascript for the theme
        #
        # @param context [Object] the Liquid context
        # @return [String] the Javascript for the theme
        #
        def render(context)
          view = context.registers[:view]

          view.javascript_include_tag("#{view.current_theme}/frontend")
        end
      end
    end
  end
end

::Liquid::Template.register_tag("theme_javascript",
                                Archangel::Liquid::Tags::ThemeJavascriptTag)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
archangel-0.0.8 lib/archangel/liquid/tags/theme_javascript_tag.rb
archangel-0.0.7 lib/archangel/liquid/tags/theme_javascript_tag.rb
archangel-0.0.6 lib/archangel/liquid/tags/theme_javascript_tag.rb
archangel-0.0.5 lib/archangel/liquid/tags/theme_javascript_tag.rb
archangel-0.0.4 lib/archangel/liquid/tags/theme_javascript_tag.rb
archangel-0.0.3 lib/archangel/liquid/tags/theme_javascript_tag.rb
archangel-0.0.2 lib/archangel/liquid/tags/theme_javascript_tag.rb