Use less to build all CSS files

CSS file names are now updated when visitor's browser must reload them
Allow files with .css extension to skip less compilation (IE6 invalid CSS syntax)
This commit is contained in:
Saivann 2013-10-22 03:17:02 -04:00
parent 25af20cceb
commit 6f034e71fb
5 changed files with 12 additions and 7 deletions

View file

@ -30,10 +30,15 @@ module Jekyll
Dir.chdir(less_dir) do
choices = Dir['**/*'].reject { |x| File.symlink?(x) }
if choices.include?(@file)
source = File.read(@file)
f = IO.popen("lessc -", "w+")
f.write(source)
f.close_write()
if /\.css$/.match(@file)
f = file = File.new(@file, "r")
else
source = File.read(@file)
f = IO.popen("lessc -", "w+")
f.write(source)
f.close_write()
end
css = f.readlines().join()