pages

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPermalinkPattern = "/:path:output_ext"

DefaultPermalinkPattern is the default permalink pattern for pages that aren't in a collection

Variables

View Source
var PermalinkStyles = map[string]string{
	"date":    "/:categories/:year/:month/:day/:title.html",
	"pretty":  "/:categories/:year/:month/:day/:title/",
	"ordinal": "/:categories/:year/:y_day/:title.html",
	"none":    "/:categories/:title.html",
}

PermalinkStyles defines built-in styles from https://jekyllrb.com/docs/permalinks/#builtinpermalinkstyles

Functions

This section is empty.

Types

type Document

type Document interface {
	// Paths
	URL() string // relative to site base
	Source() string
	OutputExt() string

	// Output
	Published() bool
	IsStatic() bool
	Write(io.Writer) error

	Reload() error
}

A Document is a Jekyll post, page, or file.

func NewFile

func NewFile(s Site, filename string, relpath string, fm FrontMatter) (Document, error)

NewFile creates a Page or StaticFile.

filename is the absolute filename. relpath is the path relative to the site or collection directory.

type FrontMatter added in v0.2.7

type FrontMatter = frontmatter.FrontMatter

FrontMatter is from the frontmatter package.

type Page

type Page interface {
	Document
	// Render asks a page to compute its content.
	// This has the side effect of causing the content to subsequently appear in the drop.
	Render() error
	SetContent(string)
	FrontMatter() FrontMatter
	// PostDate returns the date computed from the filename or frontmatter.
	// It is an uncaught error to call this on a page that is not a Post.
	// TODO Should posts have their own interface?
	PostDate() time.Time
	IsPost() bool

	Categories() []string
	Tags() []string
}

Page is a document with frontmatter.

type PageEmbed added in v0.2.0

type PageEmbed struct {
	Path string
}

PageEmbed can be embedded to give defaults for the Page interface.

func (*PageEmbed) IsStatic added in v0.2.7

func (p *PageEmbed) IsStatic() bool

IsStatic is in the pages.Page interface.

func (*PageEmbed) OutputExt added in v0.2.0

func (p *PageEmbed) OutputExt() string

OutputExt is in the pages.Page interface.

func (*PageEmbed) Published added in v0.2.0

func (p *PageEmbed) Published() bool

Published is in the pages.Page interface.

func (*PageEmbed) Reload added in v0.2.0

func (p *PageEmbed) Reload() error

Reload is in the pages.Page interface.

func (*PageEmbed) Source added in v0.2.7

func (p *PageEmbed) Source() string

Source is in the pages.Page interface.

func (*PageEmbed) URL added in v0.2.7

func (p *PageEmbed) URL() string

URL is in the pages.Page interface.

type Site

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

Site is the interface that the site provides to a page.

type StaticFile

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

A StaticFile is a static file. (Lint made me say this.)

func (*StaticFile) IsStatic added in v0.2.7

func (p *StaticFile) IsStatic() bool

IsStatic is in the File interface.

func (*StaticFile) OutputExt

func (f *StaticFile) OutputExt() string

func (*StaticFile) PostDate

func (f *StaticFile) PostDate() time.Time

PostDate is part of the Page interface. FIXME move this back to Page interface, or re-work this entirely.

func (*StaticFile) Published

func (f *StaticFile) Published() bool

func (*StaticFile) Reload added in v0.2.0

func (f *StaticFile) Reload() error

func (*StaticFile) Source added in v0.2.7

func (f *StaticFile) Source() string

func (*StaticFile) String

func (f *StaticFile) String() string

func (*StaticFile) ToLiquid

func (d *StaticFile) ToLiquid() interface{}

ToLiquid is part of the liquid.Drop interface.

func (*StaticFile) URL added in v0.2.7

func (f *StaticFile) URL() string

func (*StaticFile) Write

func (p *StaticFile) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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