Sha256: 03601c0b974dfd9373ce3a04bfc54b13535b411e25e4d6bbb70cdb6613f10d6b

Contents?: true

Size: 745 Bytes

Versions: 7

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

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

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

::Liquid::Template.register_tag("theme_stylesheet",
                                Archangel::Liquid::Tags::ThemeStylesheetTag)

Version data entries

7 entries across 7 versions & 1 rubygems

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