ref: 7fba250023694cd5ff74ab28955c94d874ae795d
parent: 4dcf734acd095654e5c0c64d7c8def8b51813deb
author: spf13 <[email protected]>
date: Mon Nov 3 19:42:36 EST 2014
Adding a proper css file handler (with automatic minification)
--- a/hugolib/handler_file.go
+++ b/hugolib/handler_file.go
@@ -14,8 +14,8 @@
package hugolib
import (
- "fmt"
- _ "github.com/dchest/cssmin"
+ "github.com/dchest/cssmin"
+ "github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/source"
)
@@ -29,7 +29,7 @@
results <- HandledResult{file: f}
},
fileConvert: func(f *source.File, s *Site, results HandleResults) {
-
- fmt.Println(f.Path())
+ x := cssmin.Minify(f.Bytes())
+ s.WriteDestFile(f.Path(), helpers.BytesToReader(x))
},
}