Documentation
¶
Index ¶
- Constants
- Variables
- type Document
- type Page
- type PageEmbed
- type Site
- type StaticFile
- func (f *StaticFile) MarshalYAML() (interface{}, error)
- func (f *StaticFile) OutputExt() string
- func (f *StaticFile) Permalink() string
- func (f *StaticFile) PostDate() time.Time
- func (f *StaticFile) Published() bool
- func (f *StaticFile) Reload() error
- func (f *StaticFile) SourcePath() string
- func (p *StaticFile) Static() bool
- func (f *StaticFile) String() string
- func (d *StaticFile) ToLiquid() interface{}
- func (p *StaticFile) Write(w io.Writer) error
Constants ¶
const DefaultPermalinkPattern = "/:path:output_ext"
DefaultPermalinkPattern is the default permalink pattern for pages that aren't in a collection
Variables ¶
var PermalinkStyles = map[string]string{
"date": "/:categories/:year/:month/:day/:title.html",
"pretty": "/:categories/:year/:month/:day/:title/",
"ordinal": "/:categories/:year/:y_day/:title.html",
"none": "/:categories/:title.html",
}
PermalinkStyles defines built-in styles from https://jekyllrb.com/docs/permalinks/#builtinpermalinkstyles
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document interface {
// Paths
Permalink() string // relative URL path
SourcePath() string
OutputExt() string
// Output
Published() bool
Static() bool
Write(io.Writer) error
Reload() error
}
A Document is a Jekyll post, page, or file.
type Page ¶
type Page interface {
Document
// Content asks a page to compute its content.
// This has the side effect of causing the content to subsequently appear in the drop.
Content() ([]byte, error)
SetContent(content []byte)
FrontMatter() map[string]interface{}
// PostDate returns the date computed from the filename or frontmatter.
// It is an uncaught error to call this on a page that is not a Post.
// TODO Should posts have their own interface?
PostDate() time.Time
Categories() []string
Tags() []string
}
Page is a document with frontmatter.
type PageEmbed ¶ added in v0.2.0
type PageEmbed struct {
Path string
}
PageEmbed can be embedded to give defaults for the Page interface.
func (*PageEmbed) SourcePath ¶ added in v0.2.0
SourcePath is in the pages.Page interface.
type Site ¶
type Site interface {
Config() *config.Config
RelativePath(string) string
RenderingPipeline() pipelines.PipelineInterface
OutputExt(pathname string) string
}
Site is the interface that the site provides to a page.
type StaticFile ¶
type StaticFile struct {
// contains filtered or unexported fields
}
A StaticFile is a static file. (Lint made me say this.)
func (*StaticFile) MarshalYAML ¶
func (f *StaticFile) MarshalYAML() (interface{}, error)
MarshalYAML is part of the yaml.Marshaler interface The variables subcommand uses this.
func (*StaticFile) PostDate ¶
PostDate is part of the Page interface. FIXME move this back to Page interface, or re-work this entirely.
func (*StaticFile) SourcePath ¶
func (f *StaticFile) SourcePath() string
func (*StaticFile) ToLiquid ¶
func (d *StaticFile) ToLiquid() interface{}
ToLiquid is part of the liquid.Drop interface.