package commands
import "github.com/gohugoio/hugo/commands"
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(subCmdVs ...*cobra.Command) 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 NewWatcher(port int) error
- func Reset() error
- func Undraft(cmd *cobra.Command, args []string) error
Variables ¶
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: "" /* 211 byte string literal not displayed */, RunE: func(cmd *cobra.Command, args []string) error { if err := InitializeConfig(); err != nil { return err } if buildWatch { viper.Set("disableLiveReload", true) watchConfig() } return build() }, }
HugoCmd is Hugo's root command. Every other command attached to HugoCmd is a child command to it.
Functions ¶
func AddCommands ¶
func AddCommands()
AddCommands adds child commands to the root command HugoCmd.
func Execute ¶
func Execute()
Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
func InitializeConfig ¶
InitializeConfig initializes a config file with sensible default configuration flags.
func NewContent ¶
NewContent adds new content to a Hugo site.
func NewSite ¶
NewSite creates a new Hugo site and initializes a structured Hugo directory.
func NewTheme ¶
NewTheme creates a new Hugo theme.
func NewWatcher ¶
NewWatcher creates a new watcher to watch filesystem events.
func Reset ¶
func Reset() error
Reset resets Hugo ready for a new full build. This is mainly only useful for benchmark testing etc. via the CLI commands.
func Undraft ¶
Undraft publishes the specified content by setting its draft status to false and setting its publish date to now. If the specified content is not a draft, it will log an error.
Source Files ¶
benchmark.go check.go convert.go env.go gen.go genautocomplete.go gendoc.go genman.go hugo.go hugo_windows.go import_jekyll.go limit_others.go list.go list_config.go new.go server.go undraft.go version.go
- Version
- v0.18.1
- Published
- Dec 29, 2016
- Platform
- windows/amd64
- Imports
- 41 packages
- Last checked
- 3 minutes ago –
Tools for package owners.