collection

package
v0.0.0-...-72c21ce Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

Collection chainable plugin context.

func New

func New() *Collection

New creates a new instance of the Collection plugin.

func (*Collection) CollectionKey

func (self *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

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

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

func (*Collection) GroupsKey

func (self *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

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

func (*Collection) Name

func (*Collection) Name() string

func (*Collection) Process

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

type Comparer

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

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

Jump to

Keyboard shortcuts

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