theme

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

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

This section is empty.

Variables

This section is empty.

Functions

func CssDir

func CssDir(path, name string) string

CssDir returns the css directory path of a given theme.

func Dir

func Dir(path, name string) string

Dir returns the directory path for the theme with the given name inside the given path. Dir does not ensure that the directory physically exists.

func Exists

func Exists(path, name string) bool

Exists determines whether a theme with the provided name inside the given path exists.

func GeneratedDir

func GeneratedDir(path, name string) string

GeneratedDir returns the generated directory path of a given theme.

func JsDir

func JsDir(path, name string) string

JsDir returns the js directory path of a given theme.

func RunBeforeHooks

func RunBeforeHooks(path, name string) error

RunBeforeHooks executes all pre-build commands specified in the configuration of the theme with the specified name.

Note that the command context directory is the the theme directory instead of the project directory.

func TemplateDir

func TemplateDir(path, name string) string

TemplateDir returns the template directory path of a given theme.

Types

type Config

type Config struct {
	Version string
	Build   struct {
		Before []string
	}
}

Config represents a theme configuration. This is the configuration stored in the theme.yml file, which currently is not mandatory.

func GetConfig

func GetConfig(path, name string) (Config, error)

GetConfig returns the configuration stored in theme.yml of the theme with the given name inside the given path. Since theme.yml isn't mandatory, GetConfig returns an empty config if it doesn't exist.

Jump to

Keyboard shortcuts

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