filetemplate

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyDir            = apperrors.Business("base dir cannot be empty", "STAGES:EMPTY_TARGET")
	ErrFailtoCreateDir     = apperrors.System(nil, "fail to create dir", "STAGES:FAIL_TO_CREATE_DIR")
	ErrFailToParseTemplate = apperrors.System(nil, "fail to parse template", "STAGES:FAIL_TO_PARSE_TEMPLATE")
	ErrFailtoBuildFilename = apperrors.System(nil, "fail to build filename", "STAGES:FAIL_TO_BUILD_FILENAME")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Source   fetcher.Result
	Template string
	BaseDir  string
}

type Template

type Template struct {
	BaseDir string
	Date    string
	Site    string
	Title   string
	Hash    string
	// contains filtered or unexported fields
}

func New

func New(opt Options) (Template, error)

func (Template) Render

func (t Template) Render(filename string) (string, error)

Jump to

Keyboard shortcuts

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