1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-30 07:08:59 +01:00
gojekyll/pages/document.go
2017-06-30 22:59:04 -04:00

42 lines
1.1 KiB
Go

package pages
import (
"io"
"github.com/osteele/gojekyll/pipelines"
"github.com/osteele/gojekyll/templates"
)
// Document is a Jekyll page or file.
type Document interface {
// Paths
SiteRelPath() string // relative to the site source directory
Permalink() string // relative URL path
OutputExt() string
// Output
Published() bool
Static() bool
Write(RenderingContext, io.Writer) error
// Variables
PageVariables() templates.VariableMap
// Document initialization uses this.
initPermalink() error
}
// RenderingContext provides context information for rendering.
type RenderingContext interface {
RenderingPipeline() pipelines.PipelineInterface
// SiteVariables is the value of the "site" template variable.
SiteVariables() map[string]interface{} // value of the "site" template variable
}
// Container is the document container.
// It's either the Site or Collection that immediately contains the document.
type Container interface {
OutputExt(pathname string) string
PathPrefix() string // PathPrefix is the relative prefix, "" for the site and "_coll/" for a collection
}