Sha256: 4c5d9fd1682e6117efd250a07acee65208f2cea2f8bac04b599abaac59e08019

Contents?: true

Size: 777 Bytes

Versions: 1

Compression:

Stored size: 777 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
        #
        # :reek:UtilityFunction
        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

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.3.0 lib/archangel/liquid/tags/theme_stylesheet_tag.rb