generator

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const InputPostsDirArgName = "input-posts"

InputPostsDirArgName is the CLI argument name for the input posts directory.

View Source
const OutputDirArgName = "output-dir"

OutputDirArgName is the CLI argument name for the output directory.

View Source
const RawOutputFlagName = "raw"

RawOutputFlagName is the CLI flag name for enabling raw HTML output mode.

View Source
const TemplateDirFlagName = "template-dir"

TemplateDirArgName is the CLI flag name for setting a template directory

Variables

View Source
var GeneratorCommand cli.Command = cli.Command{
	Name:                   "generate",
	Aliases:                []string{"g"},
	Usage:                  "generate a static blog feed from markdown posts",
	Action:                 NewGeneratorCommand,
	UseShortOptionHandling: true,
	Arguments: []cli.Argument{
		&cli.StringArg{
			Name:      InputPostsDirArgName,
			UsageText: "<input directory>",
		},
		&cli.StringArg{
			Name:      OutputDirArgName,
			UsageText: "<output directory>",
		},
	},
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:    RawOutputFlagName,
			Aliases: []string{"r"},
			Usage:   "output raw HTML without template wrapper (skips tag pages and template rendering)",
			Value:   false,
		},
		&cli.StringFlag{
			Name:    TemplateDirFlagName,
			Aliases: []string{"t"},
			Usage:   "directory of templates to use when rendering",
		},
	},
}

GeneratorCommand is the main entry point for the GoBlog generate CLI tool. This command is used to set up all the flags, usage info and the action to for generate.

Functions

func NewGeneratorCommand added in v2.0.3

func NewGeneratorCommand(ctx context.Context, c *cli.Command) error

NewGeneratorCommand handles the generate command by processing markdown posts into HTML.

Types

This section is empty.

Jump to

Keyboard shortcuts

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