1
0
mirror of https://github.com/danog/gojekyll.git synced 2025-01-22 23:01:18 +01:00
gojekyll/pages/interfaces.go

40 lines
1.0 KiB
Go
Raw Normal View History

package pages
import (
"io"
2017-07-06 19:31:36 -04:00
"github.com/osteele/gojekyll/config"
2017-06-24 14:00:19 -04:00
"github.com/osteele/gojekyll/pipelines"
)
2017-07-08 19:57:41 -04:00
// A Document is a Jekyll post, page, or file.
type Document interface {
// Paths
2017-07-08 19:57:41 -04:00
Permalink() string // relative URL path
SourcePath() string // relative to the site source directory
OutputExt() string
// Output
Published() bool
Static() bool
2017-07-04 17:36:06 -04:00
Write(io.Writer, RenderingContext) error
2017-07-03 09:37:14 -04:00
Categories() []string
Tags() []string
}
// RenderingContext provides context information for rendering.
type RenderingContext interface {
2017-06-24 14:00:19 -04:00
RenderingPipeline() pipelines.PipelineInterface
2017-07-03 10:39:55 -04:00
// Site is the value of the "site" template variable.
Site() interface{} // used as a drop in the rendering context
2017-06-24 11:58:12 -04:00
}
// Container is the document container.
// It's either the Site or Collection that immediately contains the document.
type Container interface {
2017-07-06 19:31:36 -04:00
Config() *config.Config
2017-06-24 11:58:12 -04:00
OutputExt(pathname string) string
PathPrefix() string // PathPrefix is the relative prefix, "" for the site and "_coll/" for a collection
}