Documentation
¶
Index ¶
- type Pipeline
- func (p *Pipeline) ApplyLayout(name string, data []byte, e map[string]interface{}) ([]byte, error)
- func (p *Pipeline) CopySassFileIncludes() error
- func (p *Pipeline) FindLayout(base string, fm *map[string]interface{}) (tpl *liquid.Template, err error)
- func (p *Pipeline) LayoutsDir() string
- func (p *Pipeline) OutputExt(pathname string) string
- func (p *Pipeline) Render(w io.Writer, b []byte, filename string, lineNo int, e map[string]interface{}) ([]byte, error)
- func (p *Pipeline) SassIncludePaths() []string
- func (p *Pipeline) SourceDir() string
- func (p *Pipeline) TemplateEngine() *liquid.Engine
- func (p *Pipeline) WriteSass(w io.Writer, b []byte) error
- type PipelineInterface
- type PipelineOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pipeline ¶
type Pipeline struct { PipelineOptions // contains filtered or unexported fields }
Pipeline applies a rendering transformation to a file.
func NewPipeline ¶
func NewPipeline(c config.Config, options PipelineOptions) (*Pipeline, error)
NewPipeline makes a rendering pipeline.
func (*Pipeline) ApplyLayout ¶
ApplyLayout applies the named layout to the data.
func (*Pipeline) CopySassFileIncludes ¶
CopySassFileIncludes copies sass partials into a temporary directory, removing initial underscores. TODO delete the temp directory when done
func (*Pipeline) FindLayout ¶
func (p *Pipeline) FindLayout(base string, fm *map[string]interface{}) (tpl *liquid.Template, err error)
FindLayout returns a template for the named layout.
func (*Pipeline) LayoutsDir ¶
LayoutsDir returns the path to the layouts directory.
func (*Pipeline) Render ¶
func (p *Pipeline) Render(w io.Writer, b []byte, filename string, lineNo int, e map[string]interface{}) ([]byte, error)
Render returns nil iff it wrote to the writer
func (*Pipeline) SassIncludePaths ¶
SassIncludePaths returns an array of sass include directories.
func (*Pipeline) SourceDir ¶
SourceDir returns the site source directory. Seeing how far we can bend the Law of Demeter.
func (*Pipeline) TemplateEngine ¶
TemplateEngine returns the Liquid engine.
type PipelineInterface ¶
type PipelineInterface interface { ApplyLayout(string, []byte, map[string]interface{}) ([]byte, error) OutputExt(pathname string) string Render(io.Writer, []byte, string, int, map[string]interface{}) ([]byte, error) }
PipelineInterface applies transformations to a document.
type PipelineOptions ¶
type PipelineOptions struct {
RelativeFilenameToURL tags.LinkTagHandler
}
PipelineOptions configures a pipeline.