Class: Jekyll::Less::LessCssGenerator
- Inherits:
-
Generator
- Object
- Generator
- Jekyll::Less::LessCssGenerator
- Defined in:
- lib/jekyll-less.rb
Instance Method Summary collapse
-
#generate(site) ⇒ Object
Jekyll will have already added the *.less files as Jekyll::StaticFile objects to the static_files array.
Instance Method Details
#generate(site) ⇒ Object
Jekyll will have already added the *.less files as Jekyll::StaticFile objects to the static_files array. Here we replace those with a LessCssFile object.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/jekyll-less.rb', line 49 def generate(site) site.static_files.clone.each do |sf| if sf.kind_of?(Jekyll::StaticFile) && sf.path =~ /\.less$/ site.static_files.delete(sf) name = File.basename(sf.path) destination = File.dirname(sf.path).sub(site.source, '') site.static_files << LessCssFile.new(site, site.source, destination, name) end end end |