plugins

package
v1.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 29 Imported by: 0

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 Install

func Install(names []string, site Site) (map[string]Plugin, error)

Install constructs and initializes the registered plugins.

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.

func Lookup

func Lookup(name string) (Factory, bool)

Lookup returns the factory for a registered plugin.

type Page added in v1.0.3

type Page = pages.Page

Page is in package pages.

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

type SitemapAlternate struct {
	Language string
	URL      string
	XDefault bool
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL