Documentation
¶
Overview ¶
Package plugins holds emulated Jekyll plugins.
Unlike Jekyll, these are baked into the executable -- both because package "plugin' works only on Linux (as of 2017.07); and because the jigyll implementation is immature and any possible interfaces are far from baked.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Names ¶ added in v0.2.5
func Names() []string
Names returns a sorted list of names of registered plugins.
func RenderLocalizedSitemap ¶ added in v1.10.0
func RenderLocalizedSitemap(entries []SitemapEntry) string
RenderLocalizedSitemap renders a localized aggregate sitemap. Entries and alternates are sorted so equivalent project generations produce identical artifacts regardless of document discovery order.
Types ¶
type Factory ¶ added in v1.10.0
type Factory func() Plugin
Factory constructs a fresh plugin instance for a site.
type Plugin ¶
type Plugin interface {
AfterInitSite(Site) error
ConfigureTemplateEngine(*liquid.Engine) error
ModifyPluginList([]string) []string
ModifySiteDrop(Site, map[string]interface{}) error
PostInitPage(Site, Page) error
PostReadSite(Site) error
PostRender([]byte) ([]byte, error)
}
Plugin describes the hooks that a plugin can override.
type Site ¶
type Site interface {
AddHTMLPage(url string, tpl string, fm pages.FrontMatter)
AddPage(p Page)
RemoveRoute(url string)
Config() *config.Config
TemplateEngine() *liquid.Engine
Pages() []Page
Posts() []Page
HasLayout(string) bool
HasRoute(string) bool
LocalizedURL(string) string
FilenameURLPath(string) (string, bool)
}
Site is the site interface that is available to plugins.
type SitemapAlternate ¶ added in v1.10.0
SitemapAlternate is one published alternate for a sitemap URL entry.
type SitemapEntry ¶ added in v1.10.0
type SitemapEntry struct {
URL string
LastModified string
Alternates []SitemapAlternate
}
SitemapEntry is one aggregate sitemap record.