# frozen_string_literal: true
module Katex
  # Registers KaTeX fonts, stylesheets, and javascripts with Rails.
  class Engine < ::Rails::Engine
    initializer 'katex.assets' do |app|
      # We deliberately do not place the assets in vendor/assets but in
      # vendor/katex instead, as vendor/assets is added to asset paths
      # by default but have to avoid including the non-sprockets stylesheet.
      %w(fonts javascripts).each do |sub|
        app.config.assets.paths << root.join('vendor', 'katex', sub).to_s
      end
      # Use sprockets versions of katex CSS that use asset-path for
      # referencing fonts.
      # One file is a Sass partial and the other one is .css.erb.
      app.config.assets.paths << root.join(
        'vendor', 'katex', 'sprockets', 'stylesheets'
      ).to_s
    end
  end
end

# frozen_string_literal: true
module Katex
  # Registers KaTeX fonts, stylesheets, and javascripts with Rails.
  class Engine < ::Rails::Engine
    initializer 'katex.assets' do |app|
      # We deliberately do not place the assets in vendor/assets but in
      # vendor/katex instead, as vendor/assets is added to asset paths
      # by default but have to avoid including the non-sprockets stylesheet.
      %w(fonts javascripts images).each do |sub|
        app.config.assets.paths << root.join('vendor', 'katex', sub).to_s
      end
      # Use sprockets versions of katex CSS that use asset-path for
      # referencing fonts.
      # One file is a Sass partial and the other one is .css.erb.
      app.config.assets.paths << root.join(
        'vendor', 'katex', 'sprockets', 'stylesheets'
      ).to_s
    end
  end
end

Add vendor/images to asset lookup path
Add vendor/images to asset lookup path
