From 7fba250023694cd5ff74ab28955c94d874ae795d Mon Sep 17 00:00:00 2001 From: spf13 Date: Tue, 4 Nov 2014 00:42:36 -0500 Subject: [PATCH] Adding a proper css file handler (with automatic minification) --- hugolib/handler_file.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hugolib/handler_file.go b/hugolib/handler_file.go index 093fc686d..39a905770 100644 --- 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 @@ var css = Handle{ 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)) }, }