mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Adding a proper css file handler (with automatic minification)
This commit is contained in:
parent
4dcf734acd
commit
7fba250023
1 changed files with 4 additions and 4 deletions
|
@ -14,8 +14,8 @@
|
||||||
package hugolib
|
package hugolib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"github.com/dchest/cssmin"
|
||||||
_ "github.com/dchest/cssmin"
|
"github.com/spf13/hugo/helpers"
|
||||||
"github.com/spf13/hugo/source"
|
"github.com/spf13/hugo/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ var css = Handle{
|
||||||
results <- HandledResult{file: f}
|
results <- HandledResult{file: f}
|
||||||
},
|
},
|
||||||
fileConvert: func(f *source.File, s *Site, results HandleResults) {
|
fileConvert: func(f *source.File, s *Site, results HandleResults) {
|
||||||
|
x := cssmin.Minify(f.Bytes())
|
||||||
fmt.Println(f.Path())
|
s.WriteDestFile(f.Path(), helpers.BytesToReader(x))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue