mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Adding a proper css file handler (with automatic minification)
This commit is contained in:
@@ -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))
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user