Documentation
¶
Overview ¶
Package walker provides directory traversal and template rendering functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// TemplateDir is the source directory containing templates.
TemplateDir string
// OutputDir is the destination directory for rendered output.
OutputDir string
// Data is the template data to use for rendering.
Data any
// Engine is the template rendering engine.
Engine *engine.Engine
// Writer is the output writer.
Writer *output.Writer
// TransformPath is an optional callback to transform relative paths.
// If nil, paths are used as-is.
// The function receives the relative path and data, and returns the transformed path.
TransformPath func(relPath string, data any) (string, error)
// ValidateSymlinks enables symlink security validation.
// When true, symlinks that resolve outside the template directory cause an error.
ValidateSymlinks bool
// OnRendered is called after a template file is rendered.
// Parameters: source relative path, destination absolute path.
OnRendered func(srcRel, dstAbs string)
// OnCopied is called after a non-template file is copied.
// Parameters: source relative path, destination absolute path.
OnCopied func(srcRel, dstAbs string)
}
Config holds configuration for directory walking and rendering.
Click to show internal directories.
Click to hide internal directories.