command

package
v0.0.0-...-14122a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Build is command of 'build'
	Build = cli.Command{
		Name:  "build",
		Usage: "build static files",
		Flags: []cli.Flag{
			buildSourceFlag,
			buildDestFlag,
			buildThemeFlag,
			buildWatchFlag,
			debugFlag,
		},
		Before: Before,
		Action: func(ctx *cli.Context) {

			build(newContext(ctx, true), false)
		},
	}
)
View Source
var (
	// Deploy is command `deploy`
	Deploy = cli.Command{
		Name:  "deploy",
		Usage: "deploy static website",
	}
)
View Source
var (
	// Doc is command of 'doc'
	Doc = cli.Command{
		Name:  "doc",
		Usage: "run documentation server",
		Flags: []cli.Flag{
			addrFlag,
			debugFlag,
		},
		Before: Before,
		Action: docServ,
	}
)
View Source
var (
	// Version is command of 'version'
	Version = cli.Command{
		Name:  "version",
		Usage: "print PuGo Version",
		Action: func(ctx *cli.Context) {
			if vars.Commit == "" {
				fmt.Printf("%v version %v ~ %s\n", ctx.App.Name, ctx.App.Version, ctx.App.Compiled.Format("2006/01/02 15:04"))
				return
			}
			fmt.Printf("%v version %v ~ %s\n", ctx.App.Name, ctx.App.Version, vars.Commit)
		},
	}
)

Functions

func Before

func Before(ctx *cli.Context) error

Before set before handler when start run cli.App

func New

func New(srcDir, tplDir string) cli.Command

New return command that create default site, page or post

func Server

func Server(opt *builder.Option) cli.Command

Server returns command serve files

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL