1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-27 01:34:41 +01:00
gojekyll/pages/interfaces.go
2017-07-08 19:57:41 -04:00

40 lines
1.0 KiB
Go

package pages
import (
"io"
"github.com/osteele/gojekyll/config"
"github.com/osteele/gojekyll/pipelines"
)
// A Document is a Jekyll post, page, or file.
type Document interface {
// Paths
Permalink() string // relative URL path
SourcePath() string // relative to the site source directory
OutputExt() string
// Output
Published() bool
Static() bool
Write(io.Writer, RenderingContext) error
Categories() []string
Tags() []string
}
// RenderingContext provides context information for rendering.
type RenderingContext interface {
RenderingPipeline() pipelines.PipelineInterface
// Site is the value of the "site" template variable.
Site() interface{} // used as a drop in the rendering context
}
// Container is the document container.
// It's either the Site or Collection that immediately contains the document.
type Container interface {
Config() *config.Config
OutputExt(pathname string) string
PathPrefix() string // PathPrefix is the relative prefix, "" for the site and "_coll/" for a collection
}