goldsmith-components: Index | Files

package collection

import ""

Package collection groups related pages into named collections. This can be useful for presenting blog posts on your front page, and displaying summary information about other types of content on your website. It can be used in conjunction with the "pager" plugin to create large collections which are split across several pages.


Package Files


type Collection Uses

type Collection struct {
    // contains filtered or unexported fields

Collection chainable plugin context.

func New Uses

func New() *Collection

New creates a new instance of the Collection plugin.

func (*Collection) CollectionKey Uses

func (plugin *Collection) CollectionKey(collectionKey string) *Collection

CollectionKey sets the metadata key used to access the collection name (default: "Collection"). The metadata associated with this key can be either a single string or an array of strings.

func (*Collection) Comparer Uses

func (plugin *Collection) Comparer(comparer Comparer) *Collection

Comparer sets the function used to sort files in collection groups (default: sort by filenames).

func (*Collection) Finalize Uses

func (plugin *Collection) Finalize(context *goldsmith.Context) error

func (*Collection) GroupsKey Uses

func (plugin *Collection) GroupsKey(groupsKey string) *Collection

GroupsKey sets the metadata key used to store information about collection groups (default: "Groups"). This information is stored as a mapping of group names to contained files.

func (*Collection) Initialize Uses

func (*Collection) Initialize(context *goldsmith.Context) (goldsmith.Filter, error)

func (*Collection) Name Uses

func (*Collection) Name() string

func (*Collection) Process Uses

func (plugin *Collection) Process(context *goldsmith.Context, inputFile *goldsmith.File) error

type Comparer Uses

type Comparer func(i, j *goldsmith.File) (less bool)

A Comparer callback function is used to sort files within a collection group.

Package collection imports 5 packages (graph). Updated 2019-04-08. Refresh now. Tools for package owners.