Documentation ¶
Overview ¶
Package commands defines and implements command-line commands and flags used by Hugo. Commands and flags are implemented using Cobra.
Index ¶
- Variables
- func AddCommands()
- func Execute()
- func InitializeConfig(running bool, doWithCommandeer func(c *commandeer) error, ...) (*commandeer, error)
- func NewContent(cmd *cobra.Command, args []string) error
- func NewSite(cmd *cobra.Command, args []string) error
- func NewTheme(cmd *cobra.Command, args []string) error
- func Reset() error
Constants ¶
This section is empty.
Variables ¶
var Hugo *hugolib.HugoSites
Hugo represents the Hugo sites to build. This variable is exported as it is used by at least one external library (the Hugo caddy plugin). We should provide a cleaner external API, but until then, this is it.
var HugoCmd = &cobra.Command{ Use: "hugo", Short: "hugo builds your site", Long: `hugo is the main command, used to build your Hugo site. Hugo is a Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. Complete documentation is available at http://gohugo.io/.`, RunE: func(cmd *cobra.Command, args []string) error { cfgInit := func(c *commandeer) error { if buildWatch { c.Set("disableLiveReload", true) } c.Set("renderToMemory", renderToMemory) return nil } c, err := InitializeConfig(buildWatch, cfgInit) if err != nil { return err } return c.build() }, }
HugoCmd is Hugo's root command. Every other command attached to HugoCmd is a child command to it.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
func InitializeConfig ¶
func InitializeConfig(running bool, doWithCommandeer func(c *commandeer) error, subCmdVs ...*cobra.Command) (*commandeer, error)
InitializeConfig initializes a config file with sensible default configuration flags.
func NewContent ¶
NewContent adds new content to a Hugo site.
Types ¶
This section is empty.