Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = cli.Command{ Name: "minify", Aliases: []string{"m"}, Usage: "minify html", Flags: []cli.Flag{ cli.StringFlag{ Name: "src, s", Usage: "source folder", }, cli.StringSliceFlag{ Name: "ext, e", Value: &cli.StringSlice{".html", ".xhtml"}, Usage: "file extensions", }, }, Action: func(c *cli.Context) error { src := c.String("src") if len(src) == 0 { cli.ShowCommandHelp(c, "minify") return nil } m := _minify.New() m.AddFunc("text/html", html.Minify) return filepath.Walk(src, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() { return nil } for _, f := range c.StringSlice("ext") { if filepath.Ext(info.Name()) == f { return min(m, src, path) } } return nil }) }, }
Command minify
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.