Documentation
¶
Overview ¶
Package collections is a medusa transformer that group files together in collections.
It stores the collections in a Collections type at the "Collections" key in the global store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoName = errors.New("no collection name specified") ErrNoPattern = errors.New("no collection pattern specified") )
Functions ¶
func New ¶
func New(collectionCfgs ...CollectionConfig) medusa.Transformer
Adds a "Collections" key to global store. The value is of type Collections.
Types ¶
type Collection ¶
type CollectionConfig ¶
type CollectionConfig struct { // The name of the collection. Name string // Glob pattern for files to add in // collection. Patterns []string // Store defines the data to add // the files in the collections's stores Store medusa.Store // 0 if a == b, // -1 if a < b, // +1 if a > b. SortBy func(a medusa.File, b medusa.File) int FilterFunc func(file medusa.File) bool // Don't reverse. // By default it is false. DontReverse bool // zero is unlimited Limit int // Whether to include content in the // store of collections IncludeContent bool }
Pattern and Name is the only non-optional field
Click to show internal directories.
Click to hide internal directories.