themes

package
v0.0.0-...-fa3d426 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() map[string]*Theme

All returns all installed themes

func CompileSass

func CompileSass(sassFilePath string, sassVars string, outPath string) error

CompileSass compiles given sass file

func Dir

func Dir() string

Dir returns path to themes directory

func Exist

func Exist(id string) bool

Exist returns true if a theme with given id exists

func SetDir

func SetDir(path string)

SetDir sets path to themes directory

Types

type Conf

type Conf struct {
	ID       string     `json:"id"`
	Name     string     `json:"name"`
	Author   string     `json:"author,omitempty"`
	Homepage string     `json:"homepage,omitempty"`
	Palettes []*Palette `json:"palettes,omitempty"`
}

Conf represents a theme configuration

func AllConf

func AllConf() []*Conf

AllConf returns all installed themes configurations

type Palette

type Palette struct {
	Name string            `json:"name"`
	Vars map[string]string `json:"vars"`
}

Palette represents a theme palette

func NewPalette

func NewPalette(name string) *Palette

NewPalette instanciates a new Palette

type Theme

type Theme struct {
	ID string

	Dir          string
	AssetsDir    string
	TemplatesDir string
	PartialsDir  string
	SassDir      string
	Conf         *Conf
	// contains filtered or unexported fields
}

Theme represents a theme

func Get

func Get(id string) *Theme

Get returns theme instance for given theme id

func New

func New(id string) *Theme

New instanciates a new Theme

func (*Theme) AssetExist

func (t *Theme) AssetExist(relativePath string) bool

AssetExist returns true if asset at given relative path exists in theme

func (*Theme) HaveSass

func (t *Theme) HaveSass() bool

HaveSass returns true if theme have sass files

func (*Theme) Palette

func (t *Theme) Palette(name string) *Palette

Palette returns the Palette with given name

func (*Theme) Partials

func (t *Theme) Partials() ([]string, error)

Partials returns an array of partials paths

func (*Theme) SassBuild

func (t *Theme) SassBuild(sassVars string, output string) error

SassBuild builds all sass files with given sass vars overwrites, and outputs result into given directory

func (*Theme) SassFile

func (t *Theme) SassFile(subPath string) string

SassFile returns the absolute path to given sass file

func (*Theme) SassFiles

func (t *Theme) SassFiles() ([]os.FileInfo, error)

SassFiles returns theme sass files infos

func (*Theme) SassVars

func (t *Theme) SassVars() (map[string]string, error)

SassVars returns the sass variables found in theme

func (*Theme) Template

func (t *Theme) Template(id string) string

Template returns template path

Jump to

Keyboard shortcuts

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