tomkr4l / font_awesome5_rails

font_awesome_5_rails is font awesome 5 gem bundled for rails asset pipeline
https://fontawesome.com/
MIT License
158 stars 25 forks source link

Using Pro #41

Open chmich opened 5 years ago

chmich commented 5 years ago

Dear Tomkra,

would this be an idea?:

FontAwesome5.configure do |config|
  config.source_config_folder = true
end

and then your gem would drag the sources from config/fontawesome/ instead from the gem-folder? Then i would be able to put my downloaded pro-icons there. necessary would be a little tutorial about the directory-structure

reasons:

Thanks, Christian

tomkr4l commented 5 years ago

Hello @chmich,

sounds interesting to me. So you want to use your own paths to icons, css and js files and be able to config It through initalizer or so? Maybe It would be nice to be able to directly specify path to your FA files. Something you suggested but like this:

FontAwesome5.configure do |config|
  config.source_config_folder = 'path/to/folder'
end

Do I understand your problem correctly? I will look at it in near future :).

chmich commented 5 years ago

Thanks Thomas,

yes, thats what i meant.

except one thing: i also had the idea of a configuration for a individual 'path/to/folder'. that would be rails-like.

but, what not is rails-like: Licences. For that, i had the idea, that the gem should not allow the licenced pro-fonts inside the public-folder. That was the only reason for a fixed alternate-path (IF you want to care about this point).

krtschmr commented 5 years ago

Hi guys i've boosted this gem to the pro version.

https://github.com/krtschmr/font_awesome_pro5_rails

@tomkra thanks for your great work!

simmerz commented 1 year ago

Just looking at this, the inline icon helper currently only grabs icons in the app/assets/images/fa5 directory that is in the gem itself.

Of course, to allow Pro, we need to allow someone to download the pro pack and put it somewhere.

The issue with keeping the icons outside of the asset pipeline is that the image_tag approach to using the icons wouldn't work. I'm not sure if that's 100% desirable.

Perhaps we could configure a paths config option that if Rails is present appends the app/assets and vendor/assets options to, but can be appended to with an initializer much like the Rails.application.config.assets.paths option does?

That way you can put them wherever you like (in lib or config or elsewhere) without any issue, the inline parser can find the file, and it's down to you as the developer to choose to not use the image_tag approach.