Sha256: db3cf9aadfa8c952ca1b96c9cc6941334de875655c8ebd4af650a8edda7659cc

Contents?: true

Size: 1.3 KB

Versions: 21

Compression:

Stored size: 1.3 KB

Contents

module Plutonium
  module Helpers
    module AssetsHelper
      def resource_stylesheet_tag
        url = if Plutonium.development?
          filename = JSON.parse(File.read(Plutonium.root.join("src", "build", "css.manifest")))["plutonium.css"]
          "/build/#{filename}"
        else
          resource_stylesheet_asset
        end
        stylesheet_link_tag url, "data-turbo-track": "reload"
      end

      def resource_script_tag
        url = if Plutonium.development?
          filename = JSON.parse(File.read(Plutonium.root.join("src", "build", "js.manifest")))["plutonium.js"]
          "/build/#{filename}"
        else
          resource_script_asset
        end
        javascript_include_tag url, "data-turbo-track": "reload", type: "module"
      end

      def resource_favicon_tag
        favicon_link_tag resource_favicon_asset
      end

      def resource_logo_tag(classname:)
        image_tag resource_logo_asset, class: classname
      end

      def resource_logo_asset = Rails.application.config.plutonium.assets.logo

      def resource_stylesheet_asset = Rails.application.config.plutonium.assets.stylesheet

      def resource_script_asset = Rails.application.config.plutonium.assets.script

      def resource_favicon_asset = Rails.application.config.plutonium.assets.favicon
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
plutonium-0.14.0 lib/plutonium/helpers/assets_helper.rb
plutonium-0.13.3 lib/plutonium/helpers/assets_helper.rb
plutonium-0.13.2 lib/plutonium/helpers/assets_helper.rb
plutonium-0.13.1 lib/plutonium/helpers/assets_helper.rb
plutonium-0.13.0 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.14 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.13 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.12 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.11 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.10 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.9 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.8 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.7 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.5 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.4 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.3 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.2 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.1 lib/plutonium/helpers/assets_helper.rb
plutonium-0.12.0 lib/plutonium/helpers/assets_helper.rb
plutonium-0.11.2 lib/plutonium/helpers/assets_helper.rb