mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
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:
parent
25af20cceb
commit
6f034e71fb
5 changed files with 12 additions and 7 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue