collection

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultCollectionPermalinkPattern = "/:collection/:path:output_ext"

DefaultCollectionPermalinkPattern is the default permalink pattern for pages in the posts collection

View Source
const DefaultPostsCollectionPermalinkPattern = "/:categories/:year/:month/:day/:title.html"

DefaultPostsCollectionPermalinkPattern is the default collection permalink pattern

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Name     string
	Metadata map[string]interface{}
	// contains filtered or unexported fields
}

Collection is a Jekyll collection https://jekyllrb.com/docs/collections/.

func New

func New(s Site, name string, metadata map[string]interface{}) *Collection

New creates a new Collection

func (*Collection) AbsDir

func (c *Collection) AbsDir() string

AbsDir returns the absolute path to the collection directory.

func (*Collection) IsPostsCollection

func (c *Collection) IsPostsCollection() bool

IsPostsCollection returns true if the collection is the special "posts" collection.

func (*Collection) Output

func (c *Collection) Output() bool

Output returns a bool indicating whether files in this collection should be written.

func (*Collection) Pages

func (c *Collection) Pages() []Page

Pages in the Post collection are ordered by date.

func (*Collection) PathPrefix

func (c *Collection) PathPrefix() string

PathPrefix returns the collection's directory prefix, e.g. "_posts/"

func (*Collection) PermalinkPattern

func (c *Collection) PermalinkPattern() string

PermalinkPattern returns the default permalink pattern for this collection.

func (*Collection) ReadPages

func (c *Collection) ReadPages() error

ReadPages scans the file system for collection pages, and adds them to c.Pages.

func (*Collection) Render added in v0.2.4

func (c *Collection) Render() error

Render renders the collection's pages.

func (*Collection) String added in v0.2.5

func (c *Collection) String() string

func (*Collection) ToLiquid

func (c *Collection) ToLiquid() interface{}

ToLiquid returns the value of the collection in the template "collections" array.

type Page added in v0.2.7

type Page = pages.Page

Page is in package pages.

type Site

type Site interface {
	Config() *config.Config
	Exclude(string) bool
	RelativePath(string) string
	RendererManager() renderers.Renderers
}

Site is the interface a site provides to its collections.

Jump to

Keyboard shortcuts

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