Documentation ¶
Index ¶
Constants ¶
const ( // JSMimeType is the mime type for javascript files. JSMimeType = "text/javascript" // CSSMimeType is the mime type for CSS files. CSSMimeType = "text/css" // TXTMimeType is the mime type for Text files TXTMimeType = "text/plain" // JSONMimeType is the mime type for JSon files. JSONMimeType = "text/json" )
Variables ¶
var Helpers template.FuncMap
Helpers are the helper functions for the templates. This is the same as template.FuncMap
var ReloadAlways bool
ReloadAlways controls weather the system will reload files ignoring the file existence check.
Functions ¶
func BuildFile ¶
func BuildFile(dist string, min Minifier, mimetype, oldname string, filenames ...string) (filename string, err error)
BuildFile will take the list of files concatenated and minify (if a minifier is provided) them. As the order of the files can be important we take the order of the file provided. If a file is listed more then once, only the first listing will be included.
Types ¶
type BuildError ¶
type BuildError []FileError
BuildError is the error type that can be generated during a build. It will be a collection of errors that can result.
func (BuildError) Error ¶
func (be BuildError) Error() string
type FileError ¶
FileError tracks the filename and the error that was produced trying to read or build the file.
type KeyValueType ¶
KeyValueType is the item type for a ordered map.
type OrderedMapType ¶
type OrderedMapType []KeyValueType
OrderedMapType provides an ordered map.
func (OrderedMapType) Exists ¶
func (omap OrderedMapType) Exists(key string) bool
Exists Checks to see if the key exists in the map.
func (OrderedMapType) ExistsAt ¶
func (omap OrderedMapType) ExistsAt(key string) (at int, ok bool)
ExistsAt returns if the items exists in the map, and where at.
func (OrderedMapType) Set ¶
func (omap OrderedMapType) Set(key, value string) OrderedMapType
Set allows you to associate a key with the value. It will override any existing value for that key.