Documentation ¶
Overview ¶
package staticdir provides tools for transforming "resource" files such as templated HTML into static content
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExcludeNone ¶
func GetChildren ¶
GetChildren retrieves all fileinfos contained by a directory.
func TemplateCopy ¶
TemplateCopy copies a source file to a target file, discarding other parameters, unless it has the extension ".tmpl", in which case it is read as a template, and executed into the target file with the data. The extension is removed. The template engine is documented at html/template.
Types ¶
type Translator ¶
type Translator struct {
Source, Target string
// ExcludeDir and ExcludeFile are used for determining if a file
// or directory should not be copied from the source to the target
// directory.
ExcludeDir func(os.FileInfo) bool
ExcludeFile func(os.FileInfo) bool
// CopyFunc is called when copying a source file to the target
// directory, after it has already been checked with
// ExcludeFile. It is passed the path to the source file, target
// file, the source fileinfo, and CopyData, which can be anything.
CopyFunc func(string, string, os.FileInfo, interface{}) error
CopyData interface{}
}
func New ¶
func New(source, target string) *Translator
func (*Translator) CopyDir ¶
func (t *Translator) CopyDir(subpath string) error
func (*Translator) Translate ¶
func (t *Translator) Translate() error
Click to show internal directories.
Click to hide internal directories.