Documentation
¶
Overview ¶
Package theme provides functions for working with verless themes.
Instead of juggling around with theme paths on your own, you should use the convenience functions from this package.
Index ¶
- Constants
- func AssetsPath(path, name string) string
- func CssPath(path, name string) string
- func Exists(path, name string) bool
- func GeneratedPath(path, name string) string
- func GetTypes(cfg *Config, defaultTypes map[string]*model.Type) map[string]*model.Type
- func JsPath(path, name string) string
- func Path(path, name string) string
- func RunBeforeHooks(path, name string, cfg *Config) error
- func TemplatePath(path, name string) string
- type Config
Constants ¶
const ( TemplatesDir string = "templates" GeneratedDir string = "generated" CssDir string = "css" JsDir string = "js" // AssetsDir is the directory containing CSS and JavaScript files. // It will replace CssDir and JsDir in a future release. AssetsDir string = "assets" Default string = "default" PageTemplate string = "page.html" ListPageTemplate string = "list-page.html" )
Variables ¶
This section is empty.
Functions ¶
func AssetsPath ¶ added in v0.4.8
AssetsPath returns the assets directory path of a given theme.
func Exists ¶
Exists determines whether a theme with the provided name inside the given path exists.
func GeneratedPath ¶ added in v0.4.8
GeneratedPath returns the generated directory path of a given theme.
func GetTypes ¶ added in v0.5.0
GetTypes returns the declared page types from the given configuration. If there are no types configured, it returns the given default types.
verless 1.0.0 will remove the types key in verless.yml, which will make this function obsolete.
func Path ¶ added in v0.4.8
Path returns the directory path for the theme with the given name inside the given path. Path does not ensure that the directory physically exists.
func RunBeforeHooks ¶
RunBeforeHooks executes all pre-build commands specified in the given theme configuration.
Note that the command context directory is the the theme directory instead of the project directory.
func TemplatePath ¶ added in v0.4.8
TemplatePath returns the template directory path of a given theme.