2017-06-24 17:19:21 +02:00
|
|
|
package pages
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2017-06-24 20:00:19 +02:00
|
|
|
"github.com/osteele/gojekyll/pipelines"
|
2017-06-24 17:19:21 +02:00
|
|
|
"github.com/osteele/gojekyll/templates"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Page is a Jekyll page.
|
|
|
|
type Page 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
|
|
|
|
|
|
|
|
// internal
|
|
|
|
initPermalink() error
|
|
|
|
}
|
|
|
|
|
|
|
|
// RenderingContext provides context information to a Page.
|
|
|
|
type RenderingContext interface {
|
2017-06-24 20:00:19 +02:00
|
|
|
RenderingPipeline() pipelines.PipelineInterface
|
2017-06-24 17:58:12 +02:00
|
|
|
SiteVariables() templates.VariableMap // value of the "site" template variable
|
|
|
|
}
|
|
|
|
|
|
|
|
// Container is the Page container; either the Site or Collection.
|
2017-06-24 17:19:21 +02:00
|
|
|
type Container interface {
|
2017-06-24 17:58:12 +02:00
|
|
|
OutputExt(pathname string) string
|
2017-06-24 17:19:21 +02:00
|
|
|
PathPrefix() string // PathPrefix is the relative prefix, "" for the site and "_coll/" for a collection
|
|
|
|
}
|