Documentation
¶
Overview ¶
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides core plugins for the markata-go static site generator.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Package plugins provides lifecycle plugins for markata-go.
Index ¶
- Constants
- Variables
- func ByNames(names []string) (pluginList []lifecycle.Plugin, warnings []string)
- func DefaultPlugins() []lifecycle.Plugin
- func ExtractFrontmatter(content string) (frontmatter, body string, err error)
- func GenerateAtom(feed *lifecycle.Feed, config *lifecycle.Config) (string, error)
- func GenerateAtomFromFeedConfig(fc *models.FeedConfig, config *lifecycle.Config) (string, error)
- func GenerateJSONFeed(feed *lifecycle.Feed, config *lifecycle.Config) (string, error)
- func GenerateJSONFeedFromFeedConfig(fc *models.FeedConfig, config *lifecycle.Config) (string, error)
- func GenerateRSS(feed *lifecycle.Feed, config *lifecycle.Config) (string, error)
- func GenerateRSSFromFeedConfig(fc *models.FeedConfig, config *lifecycle.Config) (string, error)
- func GetBool(metadata map[string]interface{}, key string, defaultVal bool) bool
- func GetBuildCache(m *lifecycle.Manager) *buildcache.Cache
- func GetPlatformAssetName() (string, error)
- func GetString(metadata map[string]interface{}, key string) string
- func GetStringSlice(metadata map[string]interface{}, key string) []string
- func MinimalPlugins() []lifecycle.Plugin
- func ParseFrontmatter(content string) (metadata map[string]interface{}, body string, err error)
- func ParseFrontmatterWithRaw(content string) (metadata map[string]interface{}, body, rawFrontmatter string, err error)
- func PlatformColors() map[string]string
- func PlatformEmoji() map[string]string
- func PlatformName() map[string]string
- func PluginByName(name string) (lifecycle.Plugin, bool)
- func RegisterPluginConstructor(name string, constructor func() lifecycle.Plugin)
- func RegisteredPlugins() []string
- func ToModelsConfig(config *lifecycle.Config) *models.Config
- func TransformPlugins() []lifecycle.Plugin
- type Admonition
- type AdmonitionExtension
- type AdmonitionParser
- func (p *AdmonitionParser) CanAcceptIndentedLine() bool
- func (p *AdmonitionParser) CanInterruptParagraph() bool
- func (p *AdmonitionParser) Close(_ ast.Node, _ text.Reader, _ parser.Context)
- func (p *AdmonitionParser) Continue(_ ast.Node, reader text.Reader, _ parser.Context) parser.State
- func (p *AdmonitionParser) Open(_ ast.Node, reader text.Reader, _ parser.Context) (ast.Node, parser.State)
- func (p *AdmonitionParser) Trigger() []byte
- type AdmonitionRenderer
- type AtomAuthor
- type AtomContent
- type AtomEntry
- type AtomFeed
- type AtomFeedLink
- type AtomLink
- type AutoArchiveConfig
- type AutoFeedTypeConfig
- type AutoFeedsConfig
- type AutoFeedsPlugin
- type AutoTitlePlugin
- type BackgroundPlugin
- func (p *BackgroundPlugin) Config() models.BackgroundConfig
- func (p *BackgroundPlugin) Configure(m *lifecycle.Manager) error
- func (p *BackgroundPlugin) GenerateBackgroundCSS() string
- func (p *BackgroundPlugin) GenerateBackgroundHTML() string
- func (p *BackgroundPlugin) GenerateBackgroundScripts() string
- func (p *BackgroundPlugin) IsEnabled() bool
- func (p *BackgroundPlugin) Name() string
- func (p *BackgroundPlugin) SetConfig(config models.BackgroundConfig)
- type BlogrollPlugin
- type Breadcrumb
- type BreadcrumbConfig
- type BreadcrumbItem
- type BreadcrumbListItem
- type BreadcrumbListJSON
- type BreadcrumbsPlugin
- type BridgingDetector
- type BuildCachePlugin
- func (p *BuildCachePlugin) Cache() *buildcache.Cache
- func (p *BuildCachePlugin) Cleanup(m *lifecycle.Manager) error
- func (p *BuildCachePlugin) Configure(m *lifecycle.Manager) error
- func (p *BuildCachePlugin) Enabled() bool
- func (p *BuildCachePlugin) Name() string
- func (p *BuildCachePlugin) Priority(stage lifecycle.Stage) int
- func (p *BuildCachePlugin) Transform(m *lifecycle.Manager) error
- type CSVFencePlugin
- func (p *CSVFencePlugin) Configure(m *lifecycle.Manager) error
- func (p *CSVFencePlugin) Name() string
- func (p *CSVFencePlugin) Priority(stage lifecycle.Stage) int
- func (p *CSVFencePlugin) Render(m *lifecycle.Manager) error
- func (p *CSVFencePlugin) SetDelimiter(delimiter rune)
- func (p *CSVFencePlugin) SetEnabled(enabled bool)
- func (p *CSVFencePlugin) SetHasHeader(hasHeader bool)
- func (p *CSVFencePlugin) SetTableClass(class string)
- type ChartJSPlugin
- func (p *ChartJSPlugin) Config() models.ChartJSConfig
- func (p *ChartJSPlugin) Configure(m *lifecycle.Manager) error
- func (p *ChartJSPlugin) Name() string
- func (p *ChartJSPlugin) Priority(stage lifecycle.Stage) int
- func (p *ChartJSPlugin) Render(m *lifecycle.Manager) error
- func (p *ChartJSPlugin) SetConfig(config models.ChartJSConfig)
- type ChromaCSSPlugin
- type Container
- type ContainerExtension
- type ContributionGraphPlugin
- func (p *ContributionGraphPlugin) Config() models.ContributionGraphConfig
- func (p *ContributionGraphPlugin) Configure(m *lifecycle.Manager) error
- func (p *ContributionGraphPlugin) Name() string
- func (p *ContributionGraphPlugin) Priority(stage lifecycle.Stage) int
- func (p *ContributionGraphPlugin) Render(m *lifecycle.Manager) error
- func (p *ContributionGraphPlugin) SetConfig(config models.ContributionGraphConfig)
- type DescriptionPlugin
- type EmbedsPlugin
- func (p *EmbedsPlugin) Config() models.EmbedsConfig
- func (p *EmbedsPlugin) Configure(m *lifecycle.Manager) error
- func (p *EmbedsPlugin) Name() string
- func (p *EmbedsPlugin) Priority(stage lifecycle.Stage) int
- func (p *EmbedsPlugin) SetConfig(config models.EmbedsConfig)
- func (p *EmbedsPlugin) Transform(m *lifecycle.Manager) error
- type FeedStats
- type FeedStatsHelper
- func (h *FeedStatsHelper) AverageReadingTime() int
- func (h *FeedStatsHelper) AverageWords() int
- func (h *FeedStatsHelper) Kpi(name string) interface{}
- func (h *FeedStatsHelper) PostCount() int
- func (h *FeedStatsHelper) PostsByTag() map[string]int
- func (h *FeedStatsHelper) PostsByYear() map[int]int
- func (h *FeedStatsHelper) TotalCodeBlocks() int
- func (h *FeedStatsHelper) TotalCodeLines() int
- func (h *FeedStatsHelper) TotalReadingTime() int
- func (h *FeedStatsHelper) TotalReadingTimeText() string
- func (h *FeedStatsHelper) TotalWords() int
- func (h *FeedStatsHelper) WordsByYear() map[int]int
- type FeedsPlugin
- type GlobPlugin
- type GlossaryConfig
- type GlossaryExport
- type GlossaryPlugin
- func (p *GlossaryPlugin) Config() *GlossaryConfig
- func (p *GlossaryPlugin) Configure(m *lifecycle.Manager) error
- func (p *GlossaryPlugin) Name() string
- func (p *GlossaryPlugin) Priority(stage lifecycle.Stage) int
- func (p *GlossaryPlugin) Render(m *lifecycle.Manager) error
- func (p *GlossaryPlugin) SetConfig(config *GlossaryConfig)
- func (p *GlossaryPlugin) Terms() []*GlossaryTerm
- func (p *GlossaryPlugin) Write(m *lifecycle.Manager) error
- type GlossaryTerm
- type HeadingAnchorsPlugin
- func (p *HeadingAnchorsPlugin) Configure(m *lifecycle.Manager) error
- func (p *HeadingAnchorsPlugin) Name() string
- func (p *HeadingAnchorsPlugin) Priority(stage lifecycle.Stage) int
- func (p *HeadingAnchorsPlugin) Render(m *lifecycle.Manager) error
- func (p *HeadingAnchorsPlugin) SetClass(class string)
- func (p *HeadingAnchorsPlugin) SetEnabled(enabled bool)
- func (p *HeadingAnchorsPlugin) SetLevelRange(minLevel, maxLevel int)
- func (p *HeadingAnchorsPlugin) SetPosition(position string)
- func (p *HeadingAnchorsPlugin) SetSymbol(symbol string)
- type ImageZoomPlugin
- func (p *ImageZoomPlugin) Config() models.ImageZoomConfig
- func (p *ImageZoomPlugin) Configure(m *lifecycle.Manager) error
- func (p *ImageZoomPlugin) Name() string
- func (p *ImageZoomPlugin) Priority(stage lifecycle.Stage) int
- func (p *ImageZoomPlugin) Render(m *lifecycle.Manager) error
- func (p *ImageZoomPlugin) SetConfig(config models.ImageZoomConfig)
- func (p *ImageZoomPlugin) Write(m *lifecycle.Manager) error
- type InlineAttributeTransformer
- type JSONFeed
- type JSONFeedAuthor
- type JSONFeedItem
- type JinjaMdPlugin
- type Keys
- type KeysExtension
- type LeaderboardEntry
- type LinkCollectorPlugin
- func (p *LinkCollectorPlugin) Configure(m *lifecycle.Manager) error
- func (p *LinkCollectorPlugin) Name() string
- func (p *LinkCollectorPlugin) Priority(stage lifecycle.Stage) int
- func (p *LinkCollectorPlugin) Render(m *lifecycle.Manager) error
- func (p *LinkCollectorPlugin) SetIncludeFeeds(include bool)
- func (p *LinkCollectorPlugin) SetIncludeIndex(include bool)
- func (p *LinkCollectorPlugin) SetSiteURL(siteURL string)
- type LoadPlugin
- type MDVideoPlugin
- func (p *MDVideoPlugin) Config() models.MDVideoConfig
- func (p *MDVideoPlugin) Configure(m *lifecycle.Manager) error
- func (p *MDVideoPlugin) Name() string
- func (p *MDVideoPlugin) Priority(stage lifecycle.Stage) int
- func (p *MDVideoPlugin) Render(m *lifecycle.Manager) error
- func (p *MDVideoPlugin) SetConfig(config models.MDVideoConfig)
- type Mark
- type MarkExtension
- type MentionAuthor
- type MentionContent
- type MentionSource
- type MentionsPlugin
- type MermaidPlugin
- func (p *MermaidPlugin) Config() models.MermaidConfig
- func (p *MermaidPlugin) Configure(m *lifecycle.Manager) error
- func (p *MermaidPlugin) Name() string
- func (p *MermaidPlugin) Priority(stage lifecycle.Stage) int
- func (p *MermaidPlugin) Render(m *lifecycle.Manager) error
- func (p *MermaidPlugin) SetConfig(config models.MermaidConfig)
- type OGMetadata
- type OneLineLinkPlugin
- func (p *OneLineLinkPlugin) Config() models.OneLineLinkConfig
- func (p *OneLineLinkPlugin) Configure(m *lifecycle.Manager) error
- func (p *OneLineLinkPlugin) Name() string
- func (p *OneLineLinkPlugin) Priority(stage lifecycle.Stage) int
- func (p *OneLineLinkPlugin) Render(m *lifecycle.Manager) error
- func (p *OneLineLinkPlugin) SetConfig(config models.OneLineLinkConfig)
- type OverwriteCheckPlugin
- type PagefindInstallError
- type PagefindInstaller
- func (i *PagefindInstaller) GetCacheDir() (string, error)
- func (i *PagefindInstaller) GetCachedBinaryPath(version string) (string, error)
- func (i *PagefindInstaller) GetLatestVersion() (string, error)
- func (i *PagefindInstaller) Install() (string, error)
- func (i *PagefindInstaller) IsCached(version string) (bool, error)
- func (i *PagefindInstaller) ResolveVersion() (string, error)
- type PagefindInstallerConfig
- type PagefindPlugin
- type PaletteCSSPlugin
- type PaletteManifestEntry
- type PathConflict
- type PostStats
- type PrevNextPlugin
- type PublishFeedsPlugin
- type PublishHTMLPlugin
- type QRCodePlugin
- func (p *QRCodePlugin) Config() models.QRCodeConfig
- func (p *QRCodePlugin) Configure(m *lifecycle.Manager) error
- func (p *QRCodePlugin) Name() string
- func (p *QRCodePlugin) Priority(stage lifecycle.Stage) int
- func (p *QRCodePlugin) SetBaseURL(url string)
- func (p *QRCodePlugin) SetConfig(config models.QRCodeConfig)
- func (p *QRCodePlugin) SetOutputDir(dir string)
- func (p *QRCodePlugin) Write(m *lifecycle.Manager) error
- type RSS
- type RSSChannel
- type RSSGUID
- type RSSItem
- type ReadingTimePlugin
- type ReadingTimeResult
- type ReceivedWebMention
- type Redirect
- type RedirectsConfig
- type RedirectsPlugin
- func (p *RedirectsPlugin) Configure(m *lifecycle.Manager) error
- func (p *RedirectsPlugin) GetConfig() RedirectsConfig
- func (p *RedirectsPlugin) Name() string
- func (p *RedirectsPlugin) Priority(stage lifecycle.Stage) int
- func (p *RedirectsPlugin) SetConfig(config RedirectsConfig)
- func (p *RedirectsPlugin) Write(m *lifecycle.Manager) error
- type RenderMarkdownPlugin
- type SiteStats
- type SitemapPlugin
- type SitemapURL
- type SlugConflict
- type SlugConflictError
- type SlugConflictsPlugin
- type StaticAssetsPlugin
- type StaticFileConflict
- type StaticFileConflictWarning
- type StaticFileConflictsPlugin
- func (p *StaticFileConflictsPlugin) Collect(m *lifecycle.Manager) error
- func (p *StaticFileConflictsPlugin) Conflicts() []StaticFileConflict
- func (p *StaticFileConflictsPlugin) Name() string
- func (p *StaticFileConflictsPlugin) Priority(stage lifecycle.Stage) int
- func (p *StaticFileConflictsPlugin) SetEnabled(enabled bool)
- func (p *StaticFileConflictsPlugin) SetStaticDir(dir string)
- type StatsHelper
- func (h *StatsHelper) AverageReadingTime() int
- func (h *StatsHelper) AverageWords() int
- func (h *StatsHelper) ForFeed(feedName string) *FeedStatsHelper
- func (h *StatsHelper) Kpi(name string) interface{}
- func (h *StatsHelper) PostsByTag() map[string]int
- func (h *StatsHelper) PostsByYear() map[int]int
- func (h *StatsHelper) TotalCodeBlocks() int
- func (h *StatsHelper) TotalCodeLines() int
- func (h *StatsHelper) TotalPosts() int
- func (h *StatsHelper) TotalReadingTime() int
- func (h *StatsHelper) TotalReadingTimeText() string
- func (h *StatsHelper) TotalWords() int
- func (h *StatsHelper) WordsByYear() map[int]int
- type StatsPlugin
- type StructuredDataPlugin
- type TemplatesPlugin
- type TocEntry
- type TocPlugin
- type URLSet
- type WebMention
- type WebMentionsPlugin
- type WebmentionIOResponse
- type WebmentionLeaderboard
- type WebmentionsFetchPlugin
- func (p *WebmentionsFetchPlugin) Configure(m *lifecycle.Manager) error
- func (p *WebmentionsFetchPlugin) FetchMentions() error
- func (p *WebmentionsFetchPlugin) GetMentions() []ReceivedWebMention
- func (p *WebmentionsFetchPlugin) GetMentionsForURL(targetURL string) []ReceivedWebMention
- func (p *WebmentionsFetchPlugin) GroupMentionsByURL() map[string][]ReceivedWebMention
- func (p *WebmentionsFetchPlugin) Name() string
- func (p *WebmentionsFetchPlugin) Priority(stage lifecycle.Stage) int
- func (p *WebmentionsFetchPlugin) Transform(m *lifecycle.Manager) error
- type WebmentionsLeaderboardPlugin
- type WikilinkHoverPlugin
- func (p *WikilinkHoverPlugin) Config() models.WikilinkHoverConfig
- func (p *WikilinkHoverPlugin) Configure(m *lifecycle.Manager) error
- func (p *WikilinkHoverPlugin) Name() string
- func (p *WikilinkHoverPlugin) Priority(stage lifecycle.Stage) int
- func (p *WikilinkHoverPlugin) Render(m *lifecycle.Manager) error
- func (p *WikilinkHoverPlugin) SetConfig(config models.WikilinkHoverConfig)
- type WikilinksPlugin
- type YouTubePlugin
- func (p *YouTubePlugin) Config() models.YouTubeConfig
- func (p *YouTubePlugin) Configure(m *lifecycle.Manager) error
- func (p *YouTubePlugin) Name() string
- func (p *YouTubePlugin) Priority(stage lifecycle.Stage) int
- func (p *YouTubePlugin) Render(m *lifecycle.Manager) error
- func (p *YouTubePlugin) SetConfig(config models.YouTubeConfig)
Constants ¶
const ( // BoolTrue is the string representation of true. BoolTrue = "true" // AdmonitionTypeAside is the aside admonition type. AdmonitionTypeAside = "aside" // PositionLeft is the left position value. PositionLeft = "left" // PositionStart is the start position value. PositionStart = "start" // PositionEnd is the end position value. PositionEnd = "end" // PluginNameTemplates is the templates plugin name. PluginNameTemplates = "templates" // ThemeDefault is the default theme name. ThemeDefault = "default" // DefaultSiteURL is the default site URL used when none is configured. DefaultSiteURL = "https://example.com" // DefaultFeedPath is the default path used for feed files when not specified. DefaultFeedPath = "feed" )
String constants used throughout the plugins package. These constants help avoid magic strings and satisfy goconst linter.
const JSONFeedVersion = "https://jsonfeed.org/version/1.1"
JSONFeedVersion is the JSON Feed specification version.
Variables ¶
var ErrInvalidFrontmatter = errors.New("invalid frontmatter")
ErrInvalidFrontmatter indicates the frontmatter could not be parsed.
var KindAdmonition = ast.NewNodeKind("Admonition")
KindAdmonition is the AST node kind for admonitions.
var KindContainer = ast.NewNodeKind("Container")
KindContainer is the AST node kind for container elements.
var KindKeys = ast.NewNodeKind("Keys")
KindKeys is the AST node kind for keyboard key elements.
var KindMark = ast.NewNodeKind("Mark")
KindMark is the AST node kind for mark (highlight) elements.
Functions ¶
func ByNames ¶
ByNames creates plugin instances from a list of names. Unknown plugin names are skipped with a warning returned.
func DefaultPlugins ¶
DefaultPlugins returns all standard plugins in their recommended execution order. This is the typical set of plugins for a complete markata build.
func ExtractFrontmatter ¶
ExtractFrontmatter splits content into frontmatter YAML string and body content. Returns:
- frontmatter: the raw YAML string between --- delimiters (empty if no frontmatter)
- body: the content after the frontmatter
- err: error if frontmatter is malformed
Edge cases:
- No frontmatter (doesn't start with ---): returns empty frontmatter, full content as body
- Empty frontmatter (---, then ---): returns empty frontmatter, content after second ---
- Unclosed frontmatter: returns error
func GenerateAtom ¶
GenerateAtom generates an Atom feed from a lifecycle.Feed.
func GenerateAtomFromFeedConfig ¶
GenerateAtomFromFeedConfig generates an Atom feed from a FeedConfig.
func GenerateJSONFeed ¶
GenerateJSONFeed generates a JSON Feed 1.1 document from a lifecycle.Feed.
func GenerateJSONFeedFromFeedConfig ¶
func GenerateJSONFeedFromFeedConfig(fc *models.FeedConfig, config *lifecycle.Config) (string, error)
GenerateJSONFeedFromFeedConfig generates a JSON Feed 1.1 from a FeedConfig.
func GenerateRSS ¶
GenerateRSS generates an RSS 2.0 feed from a lifecycle.Feed.
func GenerateRSSFromFeedConfig ¶
GenerateRSSFromFeedConfig generates an RSS 2.0 feed from a FeedConfig.
func GetBool ¶
GetBool extracts a boolean value from metadata, returning defaultVal if not found or wrong type. Handles YAML boolean values: true, false, yes, no, on, off.
func GetBuildCache ¶ added in v0.6.0
func GetBuildCache(m *lifecycle.Manager) *buildcache.Cache
GetBuildCache retrieves the build cache from the manager's cache. Returns nil if not found or caching is disabled.
func GetPlatformAssetName ¶ added in v0.3.0
GetPlatformAssetName returns the Pagefind asset name for the current platform.
func GetString ¶
GetString extracts a string value from metadata, returning empty string if not found or wrong type.
func GetStringSlice ¶
GetStringSlice extracts a string slice from metadata. Handles both []interface{} (common from YAML) and []string.
func MinimalPlugins ¶
MinimalPlugins returns a minimal set of plugins for basic builds. This includes only essential plugins for rendering posts without feeds.
func ParseFrontmatter ¶
ParseFrontmatter parses content containing optional YAML frontmatter. Returns the parsed metadata as a map, the body content, and any error.
The frontmatter must be delimited by --- at the start of the content.
Example:
--- title: My Post date: 2024-01-15 tags: - go - programming --- # Content here
Edge cases handled:
- No frontmatter: returns empty map, full content as body
- Empty frontmatter: returns empty map, content after delimiters
- Invalid YAML: returns error with context
func ParseFrontmatterWithRaw ¶ added in v0.6.0
func ParseFrontmatterWithRaw(content string) (metadata map[string]interface{}, body, rawFrontmatter string, err error)
ParseFrontmatterWithRaw is like ParseFrontmatter but also returns the raw frontmatter string. This is useful for computing input hashes for incremental builds.
func PlatformColors ¶ added in v0.5.0
PlatformColors returns CSS color values for each platform.
func PlatformEmoji ¶ added in v0.5.0
PlatformEmoji returns an emoji for each platform.
func PlatformName ¶ added in v0.5.0
PlatformName returns a display name for each platform.
func PluginByName ¶
PluginByName returns a new instance of a plugin by its name. Returns the plugin and true if found, or nil and false if not found.
func RegisterPluginConstructor ¶
RegisterPluginConstructor registers a plugin constructor with the given name. This allows third-party plugins to be registered and used by name.
func RegisteredPlugins ¶
func RegisteredPlugins() []string
RegisteredPlugins returns a list of all registered plugin names.
func ToModelsConfig ¶ added in v0.6.0
ToModelsConfig converts lifecycle.Config to models.Config for template context. This is exported for use by other plugins that need to build template contexts with the full config (e.g., publish_feeds, blogroll).
func TransformPlugins ¶
TransformPlugins returns only the transform-stage plugins. Useful for adding to a custom plugin set.
Types ¶
type Admonition ¶
type Admonition struct {
ast.BaseBlock
AdmonitionType string
AdmonitionTitle string
Collapsible bool // true if ??? or ???+ syntax
DefaultOpen bool // true if ???+ (expanded by default)
Position string // "left", "right", or "" (for aside type; "" means right/default)
}
Admonition is an AST node representing an admonition block.
func NewAdmonition ¶
func NewAdmonition(adType, title string, collapsible, defaultOpen bool, position string) *Admonition
NewAdmonition creates a new Admonition node.
func (*Admonition) Dump ¶
func (n *Admonition) Dump(source []byte, level int)
Dump dumps the node for debugging.
func (*Admonition) Kind ¶
func (n *Admonition) Kind() ast.NodeKind
Kind returns the kind of this node.
type AdmonitionExtension ¶
type AdmonitionExtension struct{}
AdmonitionExtension is a goldmark extension for admonitions.
func (*AdmonitionExtension) Extend ¶
func (e *AdmonitionExtension) Extend(m goldmark.Markdown)
Extend adds the admonition parser and renderer to goldmark.
type AdmonitionParser ¶
type AdmonitionParser struct{}
AdmonitionParser is a block parser for admonitions.
func NewAdmonitionParser ¶
func NewAdmonitionParser() *AdmonitionParser
NewAdmonitionParser creates a new AdmonitionParser.
func (*AdmonitionParser) CanAcceptIndentedLine ¶
func (p *AdmonitionParser) CanAcceptIndentedLine() bool
CanAcceptIndentedLine returns true if the parser can accept indented lines.
func (*AdmonitionParser) CanInterruptParagraph ¶
func (p *AdmonitionParser) CanInterruptParagraph() bool
CanInterruptParagraph returns true if the parser can interrupt a paragraph.
func (*AdmonitionParser) Continue ¶
Continue checks if the admonition block continues. Admonition content is indented with at least 4 spaces. Blank lines are allowed within admonitions if followed by indented content.
func (*AdmonitionParser) Open ¶
func (p *AdmonitionParser) Open(_ ast.Node, reader text.Reader, _ parser.Context) (ast.Node, parser.State)
Open parses the opening line of an admonition block.
func (*AdmonitionParser) Trigger ¶
func (p *AdmonitionParser) Trigger() []byte
Trigger returns the characters that trigger this parser.
type AdmonitionRenderer ¶
AdmonitionRenderer renders Admonition nodes to HTML.
func NewAdmonitionRenderer ¶
func NewAdmonitionRenderer() *AdmonitionRenderer
NewAdmonitionRenderer creates a new AdmonitionRenderer.
func (*AdmonitionRenderer) RegisterFuncs ¶
func (r *AdmonitionRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs registers the render functions for Admonition nodes.
type AtomAuthor ¶
type AtomAuthor struct {
Name string `xml:"name"`
Email string `xml:"email,omitempty"`
URI string `xml:"uri,omitempty"`
}
AtomAuthor represents an author element in an Atom feed.
type AtomContent ¶
AtomContent represents content with a type attribute.
type AtomEntry ¶
type AtomEntry struct {
Title string `xml:"title"`
ID string `xml:"id"`
Updated string `xml:"updated,omitempty"`
Published string `xml:"published,omitempty"`
Links []AtomFeedLink `xml:"link"`
Summary *AtomContent `xml:"summary,omitempty"`
Content *AtomContent `xml:"content,omitempty"`
Author *AtomAuthor `xml:"author,omitempty"`
}
AtomEntry represents an entry element in an Atom feed.
type AtomFeed ¶
type AtomFeed struct {
XMLName xml.Name `xml:"feed"`
Xmlns string `xml:"xmlns,attr"`
Title string `xml:"title"`
ID string `xml:"id"`
Updated string `xml:"updated,omitempty"`
Links []AtomFeedLink `xml:"link"`
Author *AtomAuthor `xml:"author,omitempty"`
Entries []AtomEntry `xml:"entry"`
}
AtomFeed represents an Atom feed.
type AtomFeedLink ¶
type AtomFeedLink struct {
Href string `xml:"href,attr"`
Rel string `xml:"rel,attr,omitempty"`
Type string `xml:"type,attr,omitempty"`
}
AtomFeedLink represents a link element in an Atom feed.
type AtomLink ¶
type AtomLink struct {
Href string `xml:"href,attr"`
Rel string `xml:"rel,attr"`
Type string `xml:"type,attr"`
}
AtomLink represents an atom:link element for RSS feed self-reference.
type AutoArchiveConfig ¶
type AutoArchiveConfig struct {
// Enabled enables generation of archive feeds
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
// SlugPrefix is the URL prefix for archives (e.g., "archive" -> /archive/2024/)
SlugPrefix string `json:"slug_prefix" yaml:"slug_prefix" toml:"slug_prefix"`
// YearlyFeeds enables year-based archive feeds
YearlyFeeds bool `json:"yearly_feeds" yaml:"yearly_feeds" toml:"yearly_feeds"`
// MonthlyFeeds enables month-based archive feeds
MonthlyFeeds bool `json:"monthly_feeds" yaml:"monthly_feeds" toml:"monthly_feeds"`
// Formats specifies which output formats to generate
Formats models.FeedFormats `json:"formats" yaml:"formats" toml:"formats"`
}
AutoArchiveConfig configures automatic date archive feeds.
type AutoFeedTypeConfig ¶
type AutoFeedTypeConfig struct {
// Enabled enables generation of this feed type
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
// SlugPrefix is the URL prefix for feeds (e.g., "tags" -> /tags/python/)
SlugPrefix string `json:"slug_prefix" yaml:"slug_prefix" toml:"slug_prefix"`
// Formats specifies which output formats to generate
Formats models.FeedFormats `json:"formats" yaml:"formats" toml:"formats"`
}
AutoFeedTypeConfig configures a type of auto-generated feed (tags, categories).
type AutoFeedsConfig ¶
type AutoFeedsConfig struct {
// Tags configures automatic tag feeds
Tags AutoFeedTypeConfig `json:"tags" yaml:"tags" toml:"tags"`
// Categories configures automatic category feeds
Categories AutoFeedTypeConfig `json:"categories" yaml:"categories" toml:"categories"`
// Archives configures automatic date archive feeds
Archives AutoArchiveConfig `json:"archives" yaml:"archives" toml:"archives"`
}
AutoFeedsConfig configures automatic feed generation.
type AutoFeedsPlugin ¶
type AutoFeedsPlugin struct{}
AutoFeedsPlugin automatically generates feeds for tags, categories, and date archives. It implements ConfigurePlugin to pre-register synthetic posts for wikilink resolution, and CollectPlugin to generate the actual feed content.
func NewAutoFeedsPlugin ¶
func NewAutoFeedsPlugin() *AutoFeedsPlugin
NewAutoFeedsPlugin creates a new AutoFeedsPlugin.
func (*AutoFeedsPlugin) Collect ¶
func (p *AutoFeedsPlugin) Collect(m *lifecycle.Manager) error
Collect generates automatic feeds for tags, categories, and date archives.
func (*AutoFeedsPlugin) Load ¶ added in v0.6.0
func (p *AutoFeedsPlugin) Load(m *lifecycle.Manager) error
Load pre-registers synthetic posts for auto-generated feeds so they can be resolved by wikilinks during the Transform stage. This runs after posts are loaded but before Transform stage.
func (*AutoFeedsPlugin) Name ¶
func (p *AutoFeedsPlugin) Name() string
Name returns the unique name of the plugin.
type AutoTitlePlugin ¶
type AutoTitlePlugin struct{}
AutoTitlePlugin auto-generates human-readable titles for posts that don't have one. It uses a comprehensive fallback strategy to ensure every post has a title:
- Frontmatter title (explicit, highest priority)
- First H1 heading from markdown content
- Filename-based title (with date prefix stripping)
- Directory name (for index.md files)
- Generated fallback with timestamp
func NewAutoTitlePlugin ¶
func NewAutoTitlePlugin() *AutoTitlePlugin
NewAutoTitlePlugin creates a new AutoTitlePlugin.
func (*AutoTitlePlugin) Name ¶
func (p *AutoTitlePlugin) Name() string
Name returns the unique name of the plugin.
type BackgroundPlugin ¶ added in v0.6.0
type BackgroundPlugin struct {
// contains filtered or unexported fields
}
BackgroundPlugin adds configurable multi-layered background decorations to pages. It runs at the configure stage to validate configuration.
func NewBackgroundPlugin ¶ added in v0.6.0
func NewBackgroundPlugin() *BackgroundPlugin
NewBackgroundPlugin creates a new BackgroundPlugin with default settings.
func (*BackgroundPlugin) Config ¶ added in v0.6.0
func (p *BackgroundPlugin) Config() models.BackgroundConfig
Config returns the current background configuration.
func (*BackgroundPlugin) Configure ¶ added in v0.6.0
func (p *BackgroundPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "theme.background" key.
func (*BackgroundPlugin) GenerateBackgroundCSS ¶ added in v0.6.0
func (p *BackgroundPlugin) GenerateBackgroundCSS() string
GenerateBackgroundCSS generates the CSS for background elements. This is called by templates to inject custom CSS.
func (*BackgroundPlugin) GenerateBackgroundHTML ¶ added in v0.6.0
func (p *BackgroundPlugin) GenerateBackgroundHTML() string
GenerateBackgroundHTML generates the HTML for background elements. This is called by templates to inject background decorations.
func (*BackgroundPlugin) GenerateBackgroundScripts ¶ added in v0.6.0
func (p *BackgroundPlugin) GenerateBackgroundScripts() string
GenerateBackgroundScripts generates the script tags for background elements. This is called by templates to inject scripts.
func (*BackgroundPlugin) IsEnabled ¶ added in v0.6.0
func (p *BackgroundPlugin) IsEnabled() bool
IsEnabled returns whether the background plugin is enabled.
func (*BackgroundPlugin) Name ¶ added in v0.6.0
func (p *BackgroundPlugin) Name() string
Name returns the unique name of the plugin.
func (*BackgroundPlugin) SetConfig ¶ added in v0.6.0
func (p *BackgroundPlugin) SetConfig(config models.BackgroundConfig)
SetConfig sets the background configuration directly. This is useful for testing or programmatic configuration.
type BlogrollPlugin ¶ added in v0.5.0
type BlogrollPlugin struct {
// contains filtered or unexported fields
}
BlogrollPlugin fetches and processes external RSS/Atom feeds. It runs in the Configure stage to register synthetic posts for wikilink resolution, in the Collect stage to gather external feed entries, and in the Write stage to generate blogroll and reader pages.
func NewBlogrollPlugin ¶ added in v0.5.0
func NewBlogrollPlugin() *BlogrollPlugin
NewBlogrollPlugin creates a new BlogrollPlugin.
func (*BlogrollPlugin) Collect ¶ added in v0.5.0
func (p *BlogrollPlugin) Collect(m *lifecycle.Manager) error
Collect fetches and parses configured external feeds.
func (*BlogrollPlugin) Configure ¶ added in v0.6.0
func (p *BlogrollPlugin) Configure(m *lifecycle.Manager) error
Configure registers synthetic posts for blogroll and reader pages so they can be resolved by wikilinks during the Transform stage.
func (*BlogrollPlugin) Name ¶ added in v0.5.0
func (p *BlogrollPlugin) Name() string
Name returns the unique name of the plugin.
type Breadcrumb ¶ added in v0.5.0
type Breadcrumb struct {
// Label is the display text for the breadcrumb
Label string `json:"label"`
// URL is the href for the breadcrumb link
URL string `json:"url"`
// IsCurrent indicates if this is the current page (last item)
IsCurrent bool `json:"is_current"`
// Position is the 1-indexed position in the trail (for JSON-LD)
Position int `json:"position"`
}
Breadcrumb represents a single item in the breadcrumb trail.
type BreadcrumbConfig ¶ added in v0.5.0
type BreadcrumbConfig struct {
// Enabled controls whether breadcrumbs are shown (nil = use default)
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
// Items allows manual override of breadcrumb trail
Items []BreadcrumbItem `json:"items,omitempty" yaml:"items,omitempty"`
// ShowHome overrides the global show_home setting
ShowHome *bool `json:"show_home,omitempty" yaml:"show_home,omitempty"`
// HomeLabel overrides the global home_label
HomeLabel string `json:"home_label,omitempty" yaml:"home_label,omitempty"`
}
BreadcrumbConfig holds per-post breadcrumb configuration from frontmatter.
type BreadcrumbItem ¶ added in v0.5.0
type BreadcrumbItem struct {
Label string `json:"label" yaml:"label"`
URL string `json:"url" yaml:"url"`
}
BreadcrumbItem is a manual breadcrumb entry from frontmatter.
type BreadcrumbListItem ¶ added in v0.5.0
type BreadcrumbListItem struct {
Type string `json:"@type"`
Position int `json:"position"`
Name string `json:"name"`
Item string `json:"item,omitempty"`
}
BreadcrumbListItem is a single item in JSON-LD BreadcrumbList.
type BreadcrumbListJSON ¶ added in v0.5.0
type BreadcrumbListJSON struct {
Context string `json:"@context"`
Type string `json:"@type"`
ItemListElement []BreadcrumbListItem `json:"itemListElement"`
}
BreadcrumbListJSON is the JSON-LD structured data for breadcrumbs.
type BreadcrumbsPlugin ¶ added in v0.5.0
type BreadcrumbsPlugin struct {
// contains filtered or unexported fields
}
BreadcrumbsPlugin generates breadcrumb navigation for posts based on URL path. It supports auto-generation from directory structure, manual override via frontmatter, and produces JSON-LD structured data for SEO.
func NewBreadcrumbsPlugin ¶ added in v0.5.0
func NewBreadcrumbsPlugin() *BreadcrumbsPlugin
NewBreadcrumbsPlugin creates a new BreadcrumbsPlugin with default settings.
func (*BreadcrumbsPlugin) Configure ¶ added in v0.5.0
func (p *BreadcrumbsPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*BreadcrumbsPlugin) Name ¶ added in v0.5.0
func (p *BreadcrumbsPlugin) Name() string
Name returns the unique name of the plugin.
type BridgingDetector ¶ added in v0.5.0
type BridgingDetector struct {
// contains filtered or unexported fields
}
BridgingDetector detects and enriches webmentions with bridging metadata.
func NewBridgingDetector ¶ added in v0.5.0
func NewBridgingDetector(config models.BridgesConfig) *BridgingDetector
NewBridgingDetector creates a new BridgingDetector.
func (*BridgingDetector) DetectSource ¶ added in v0.5.0
func (d *BridgingDetector) DetectSource(sourceURL, sourceContent string) MentionSource
DetectSource detects the source platform from URL patterns.
func (*BridgingDetector) EnrichMention ¶ added in v0.5.0
func (d *BridgingDetector) EnrichMention(mention *ReceivedWebMention)
EnrichMention adds platform-specific metadata to a webmention.
func (*BridgingDetector) ShouldAccept ¶ added in v0.5.0
func (d *BridgingDetector) ShouldAccept(mention *ReceivedWebMention) bool
ShouldAccept checks if a mention should be accepted based on filters.
type BuildCachePlugin ¶ added in v0.6.0
type BuildCachePlugin struct {
// contains filtered or unexported fields
}
BuildCachePlugin manages incremental build caching. It loads the build cache at the start and saves it at the end. Other plugins can use the cache to skip unchanged posts.
func NewBuildCachePlugin ¶ added in v0.6.0
func NewBuildCachePlugin() *BuildCachePlugin
NewBuildCachePlugin creates a new BuildCachePlugin.
func (*BuildCachePlugin) Cache ¶ added in v0.6.0
func (p *BuildCachePlugin) Cache() *buildcache.Cache
Cache returns the build cache instance.
func (*BuildCachePlugin) Cleanup ¶ added in v0.6.0
func (p *BuildCachePlugin) Cleanup(m *lifecycle.Manager) error
Cleanup saves the build cache to disk.
func (*BuildCachePlugin) Configure ¶ added in v0.6.0
func (p *BuildCachePlugin) Configure(m *lifecycle.Manager) error
Configure loads the build cache and checks for global invalidation.
func (*BuildCachePlugin) Enabled ¶ added in v0.6.0
func (p *BuildCachePlugin) Enabled() bool
Enabled returns whether the build cache is enabled.
func (*BuildCachePlugin) Name ¶ added in v0.6.0
func (p *BuildCachePlugin) Name() string
Name returns the unique name of the plugin.
type CSVFencePlugin ¶
type CSVFencePlugin struct {
// contains filtered or unexported fields
}
CSVFencePlugin converts CSV code blocks into HTML tables. It processes article_html during the render stage, after render_markdown.
func NewCSVFencePlugin ¶
func NewCSVFencePlugin() *CSVFencePlugin
NewCSVFencePlugin creates a new CSVFencePlugin with default settings.
func (*CSVFencePlugin) Configure ¶
func (p *CSVFencePlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected in config.Extra["csv_fence"] as a map.
func (*CSVFencePlugin) Name ¶
func (p *CSVFencePlugin) Name() string
Name returns the unique name of the plugin.
func (*CSVFencePlugin) Priority ¶
func (p *CSVFencePlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for the render stage. Returns a positive priority to run after render_markdown.
func (*CSVFencePlugin) Render ¶
func (p *CSVFencePlugin) Render(m *lifecycle.Manager) error
Render processes article_html and converts CSV blocks to HTML tables. Posts with Skip=true or empty ArticleHTML are skipped.
func (*CSVFencePlugin) SetDelimiter ¶
func (p *CSVFencePlugin) SetDelimiter(delimiter rune)
SetDelimiter sets the CSV field delimiter.
func (*CSVFencePlugin) SetEnabled ¶
func (p *CSVFencePlugin) SetEnabled(enabled bool)
SetEnabled enables or disables the plugin.
func (*CSVFencePlugin) SetHasHeader ¶
func (p *CSVFencePlugin) SetHasHeader(hasHeader bool)
SetHasHeader sets whether the first row is treated as a header.
func (*CSVFencePlugin) SetTableClass ¶
func (p *CSVFencePlugin) SetTableClass(class string)
SetTableClass sets the CSS class for generated tables.
type ChartJSPlugin ¶ added in v0.2.0
type ChartJSPlugin struct {
// contains filtered or unexported fields
}
ChartJSPlugin converts Chart.js JSON code blocks into rendered charts. It runs at the render stage (after markdown conversion).
func NewChartJSPlugin ¶ added in v0.2.0
func NewChartJSPlugin() *ChartJSPlugin
NewChartJSPlugin creates a new ChartJSPlugin with default settings.
func (*ChartJSPlugin) Config ¶ added in v0.2.0
func (p *ChartJSPlugin) Config() models.ChartJSConfig
Config returns the current chartjs configuration.
func (*ChartJSPlugin) Configure ¶ added in v0.2.0
func (p *ChartJSPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "chartjs" key.
func (*ChartJSPlugin) Name ¶ added in v0.2.0
func (p *ChartJSPlugin) Name() string
Name returns the unique name of the plugin.
func (*ChartJSPlugin) Priority ¶ added in v0.2.0
func (p *ChartJSPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs after render_markdown (which has default priority 0).
func (*ChartJSPlugin) Render ¶ added in v0.2.0
func (p *ChartJSPlugin) Render(m *lifecycle.Manager) error
Render processes chartjs code blocks in the rendered HTML for all posts.
func (*ChartJSPlugin) SetConfig ¶ added in v0.2.0
func (p *ChartJSPlugin) SetConfig(config models.ChartJSConfig)
SetConfig sets the chartjs configuration directly. This is useful for testing or programmatic configuration.
type ChromaCSSPlugin ¶ added in v0.3.0
type ChromaCSSPlugin struct {
// contains filtered or unexported fields
}
ChromaCSSPlugin generates CSS for syntax highlighting from Chroma themes. It runs during the Write stage and creates css/chroma.css with the syntax highlighting styles that correspond to the configured theme.
This plugin works in conjunction with RenderMarkdownPlugin which uses CSS classes for syntax highlighting (via WithClasses option).
func NewChromaCSSPlugin ¶ added in v0.3.0
func NewChromaCSSPlugin() *ChromaCSSPlugin
NewChromaCSSPlugin creates a new ChromaCSSPlugin.
func (*ChromaCSSPlugin) Configure ¶ added in v0.3.0
func (p *ChromaCSSPlugin) Configure(m *lifecycle.Manager) error
Configure reads the highlight theme configuration.
func (*ChromaCSSPlugin) Name ¶ added in v0.3.0
func (p *ChromaCSSPlugin) Name() string
Name returns the unique name of the plugin.
type Container ¶ added in v0.6.0
type Container struct {
ast.BaseBlock
// Classes holds the CSS classes for this container
Classes []string
// ContainerID holds the optional ID for this container
ContainerID string
// ExtraAttrs holds additional attributes
ExtraAttrs map[string]string
}
Container is an AST node representing a container block (::: class).
func NewContainer ¶ added in v0.6.0
NewContainer creates a new Container node.
type ContainerExtension ¶ added in v0.6.0
type ContainerExtension struct{}
ContainerExtension is a goldmark extension for container syntax.
func (*ContainerExtension) Extend ¶ added in v0.6.0
func (e *ContainerExtension) Extend(m goldmark.Markdown)
Extend adds the container parser and renderer to goldmark.
type ContributionGraphPlugin ¶ added in v0.6.0
type ContributionGraphPlugin struct {
// contains filtered or unexported fields
}
ContributionGraphPlugin converts contribution-graph JSON code blocks into rendered Cal-Heatmap calendar heatmaps showing GitHub-style activity. It runs at the render stage (after markdown conversion).
func NewContributionGraphPlugin ¶ added in v0.6.0
func NewContributionGraphPlugin() *ContributionGraphPlugin
NewContributionGraphPlugin creates a new ContributionGraphPlugin with default settings.
func (*ContributionGraphPlugin) Config ¶ added in v0.6.0
func (p *ContributionGraphPlugin) Config() models.ContributionGraphConfig
Config returns the current contribution graph configuration.
func (*ContributionGraphPlugin) Configure ¶ added in v0.6.0
func (p *ContributionGraphPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "contribution_graph" key.
func (*ContributionGraphPlugin) Name ¶ added in v0.6.0
func (p *ContributionGraphPlugin) Name() string
Name returns the unique name of the plugin.
func (*ContributionGraphPlugin) Priority ¶ added in v0.6.0
func (p *ContributionGraphPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs after render_markdown (which has default priority 0).
func (*ContributionGraphPlugin) Render ¶ added in v0.6.0
func (p *ContributionGraphPlugin) Render(m *lifecycle.Manager) error
Render processes contribution-graph code blocks in the rendered HTML for all posts.
func (*ContributionGraphPlugin) SetConfig ¶ added in v0.6.0
func (p *ContributionGraphPlugin) SetConfig(config models.ContributionGraphConfig)
SetConfig sets the contribution graph configuration directly. This is useful for testing or programmatic configuration.
type DescriptionPlugin ¶
type DescriptionPlugin struct {
// contains filtered or unexported fields
}
DescriptionPlugin auto-generates descriptions for posts that don't have one. It extracts the first paragraph of content, strips markdown formatting, and truncates to a reasonable length for meta descriptions.
func NewDescriptionPlugin ¶
func NewDescriptionPlugin() *DescriptionPlugin
NewDescriptionPlugin creates a new DescriptionPlugin with default settings.
func (*DescriptionPlugin) Configure ¶
func (p *DescriptionPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*DescriptionPlugin) Name ¶
func (p *DescriptionPlugin) Name() string
Name returns the unique name of the plugin.
func (*DescriptionPlugin) Priority ¶
func (p *DescriptionPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin priority for the given stage. Description should run early in transform to have content available for other plugins.
func (*DescriptionPlugin) SetMaxLength ¶
func (p *DescriptionPlugin) SetMaxLength(length int)
SetMaxLength sets the maximum length for generated descriptions.
type EmbedsPlugin ¶ added in v0.5.0
type EmbedsPlugin struct {
// contains filtered or unexported fields
}
EmbedsPlugin processes embed syntax in markdown content. It supports two types of embeds: - Internal embeds: ![[slug]] or ![[slug|display text]] - embed another post from the same site - External embeds: !embed(https://example.com/article) - embed external content with OG metadata
The plugin runs in the Transform stage, before markdown rendering.
func NewEmbedsPlugin ¶ added in v0.5.0
func NewEmbedsPlugin() *EmbedsPlugin
NewEmbedsPlugin creates a new EmbedsPlugin with default settings.
func (*EmbedsPlugin) Config ¶ added in v0.5.0
func (p *EmbedsPlugin) Config() models.EmbedsConfig
Config returns the current plugin configuration.
func (*EmbedsPlugin) Configure ¶ added in v0.5.0
func (p *EmbedsPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "embeds" key.
func (*EmbedsPlugin) Name ¶ added in v0.5.0
func (p *EmbedsPlugin) Name() string
Name returns the unique name of the plugin.
func (*EmbedsPlugin) Priority ¶ added in v0.5.0
func (p *EmbedsPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs early in the transform stage, before wikilinks.
func (*EmbedsPlugin) SetConfig ¶ added in v0.5.0
func (p *EmbedsPlugin) SetConfig(config models.EmbedsConfig)
SetConfig sets the plugin configuration directly.
type FeedStats ¶ added in v0.5.0
type FeedStats struct {
// PostCount is the total number of posts in the feed
PostCount int `json:"post_count"`
// TotalWords is the sum of word counts across all posts
TotalWords int `json:"total_words"`
// TotalChars is the sum of character counts across all posts
TotalChars int `json:"total_chars"`
// TotalReadingTime is the sum of reading times in minutes
TotalReadingTime int `json:"total_reading_time"`
// TotalReadingTimeText is a formatted total reading time
TotalReadingTimeText string `json:"total_reading_time_text"`
// AverageWords is the average word count per post
AverageWords int `json:"average_words"`
// AverageReadingTime is the average reading time per post
AverageReadingTime int `json:"average_reading_time"`
// AverageReadingTimeText is formatted average reading time
AverageReadingTimeText string `json:"average_reading_time_text"`
// TotalCodeLines is the sum of code lines across all posts
TotalCodeLines int `json:"total_code_lines"`
// TotalCodeBlocks is the sum of code blocks across all posts
TotalCodeBlocks int `json:"total_code_blocks"`
// PostsByYear maps year to post count for this feed
PostsByYear map[int]int `json:"posts_by_year"`
// WordsByYear maps year to total word count for this feed
WordsByYear map[int]int `json:"words_by_year"`
// PostsByTag maps tag name to post count for this feed
PostsByTag map[string]int `json:"posts_by_tag"`
}
FeedStats contains aggregated statistics for a feed.
type FeedStatsHelper ¶ added in v0.5.0
type FeedStatsHelper struct {
// contains filtered or unexported fields
}
FeedStatsHelper provides template-friendly access to feed-specific statistics.
func (*FeedStatsHelper) AverageReadingTime ¶ added in v0.5.0
func (h *FeedStatsHelper) AverageReadingTime() int
AverageReadingTime returns the average reading time per post.
func (*FeedStatsHelper) AverageWords ¶ added in v0.5.0
func (h *FeedStatsHelper) AverageWords() int
AverageWords returns the average word count per post.
func (*FeedStatsHelper) Kpi ¶ added in v0.5.0
func (h *FeedStatsHelper) Kpi(name string) interface{}
Kpi returns a specific KPI value by name for this feed.
func (*FeedStatsHelper) PostCount ¶ added in v0.5.0
func (h *FeedStatsHelper) PostCount() int
PostCount returns the number of posts in the feed.
func (*FeedStatsHelper) PostsByTag ¶ added in v0.5.0
func (h *FeedStatsHelper) PostsByTag() map[string]int
PostsByTag returns a map of tag to post count for this feed.
func (*FeedStatsHelper) PostsByYear ¶ added in v0.5.0
func (h *FeedStatsHelper) PostsByYear() map[int]int
PostsByYear returns a map of year to post count for this feed.
func (*FeedStatsHelper) TotalCodeBlocks ¶ added in v0.5.0
func (h *FeedStatsHelper) TotalCodeBlocks() int
TotalCodeBlocks returns the total number of code blocks in the feed.
func (*FeedStatsHelper) TotalCodeLines ¶ added in v0.5.0
func (h *FeedStatsHelper) TotalCodeLines() int
TotalCodeLines returns the total lines of code in the feed.
func (*FeedStatsHelper) TotalReadingTime ¶ added in v0.5.0
func (h *FeedStatsHelper) TotalReadingTime() int
TotalReadingTime returns the total reading time for the feed.
func (*FeedStatsHelper) TotalReadingTimeText ¶ added in v0.5.0
func (h *FeedStatsHelper) TotalReadingTimeText() string
TotalReadingTimeText returns the formatted total reading time.
func (*FeedStatsHelper) TotalWords ¶ added in v0.5.0
func (h *FeedStatsHelper) TotalWords() int
TotalWords returns the total word count for the feed.
func (*FeedStatsHelper) WordsByYear ¶ added in v0.5.0
func (h *FeedStatsHelper) WordsByYear() map[int]int
WordsByYear returns a map of year to word count for this feed.
type FeedsPlugin ¶
type FeedsPlugin struct{}
FeedsPlugin processes configured feeds during the collect stage. It filters posts, sorts them, and paginates the results.
func (*FeedsPlugin) Collect ¶
func (p *FeedsPlugin) Collect(m *lifecycle.Manager) error
Collect processes each FeedConfig and creates feeds with filtered, sorted, and paginated posts.
func (*FeedsPlugin) Name ¶
func (p *FeedsPlugin) Name() string
Name returns the unique name of the plugin.
type GlobPlugin ¶
type GlobPlugin struct {
// contains filtered or unexported fields
}
GlobPlugin discovers content files using glob patterns.
func NewGlobPlugin ¶
func NewGlobPlugin() *GlobPlugin
NewGlobPlugin creates a new GlobPlugin with default settings.
func (*GlobPlugin) Configure ¶
func (p *GlobPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration from the manager and initializes the plugin.
func (*GlobPlugin) Glob ¶
func (p *GlobPlugin) Glob(m *lifecycle.Manager) error
Glob discovers content files matching the configured patterns.
func (*GlobPlugin) SetPatterns ¶
func (p *GlobPlugin) SetPatterns(patterns []string)
SetPatterns sets the glob patterns to use for file discovery.
func (*GlobPlugin) SetUseGitignore ¶
func (p *GlobPlugin) SetUseGitignore(use bool)
SetUseGitignore enables or disables gitignore support.
type GlossaryConfig ¶
type GlossaryConfig struct {
// Enabled controls whether the plugin is active
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
// LinkClass is the CSS class for glossary links (default: "glossary-term")
LinkClass string `json:"link_class" yaml:"link_class" toml:"link_class"`
// CaseSensitive controls whether term matching is case-sensitive (default: false)
CaseSensitive bool `json:"case_sensitive" yaml:"case_sensitive" toml:"case_sensitive"`
// Tooltip controls whether to add a title attribute with description (default: true)
Tooltip bool `json:"tooltip" yaml:"tooltip" toml:"tooltip"`
// MaxLinksPerTerm limits how many times each term is linked (0 = all, default: 1)
MaxLinksPerTerm int `json:"max_links_per_term" yaml:"max_links_per_term" toml:"max_links_per_term"`
// ExcludeTags lists tags that should not have glossary terms linked
ExcludeTags []string `json:"exclude_tags" yaml:"exclude_tags" toml:"exclude_tags"`
// ExportJSON controls whether to export glossary.json (default: true)
ExportJSON bool `json:"export_json" yaml:"export_json" toml:"export_json"`
// GlossaryPath is the path prefix for glossary posts (default: "glossary")
GlossaryPath string `json:"glossary_path" yaml:"glossary_path" toml:"glossary_path"`
// TemplateKey identifies glossary posts by templateKey frontmatter
TemplateKey string `json:"template_key" yaml:"template_key" toml:"template_key"`
}
GlossaryConfig holds configuration for the glossary plugin.
func NewGlossaryConfig ¶
func NewGlossaryConfig() *GlossaryConfig
NewGlossaryConfig creates a GlossaryConfig with default values.
type GlossaryExport ¶
type GlossaryExport struct {
Terms []*GlossaryTerm `json:"terms"`
}
GlossaryExport represents the JSON export format.
type GlossaryPlugin ¶
type GlossaryPlugin struct {
// contains filtered or unexported fields
}
GlossaryPlugin automatically links glossary terms in post content.
func NewGlossaryPlugin ¶
func NewGlossaryPlugin() *GlossaryPlugin
NewGlossaryPlugin creates a new GlossaryPlugin with default configuration.
func (*GlossaryPlugin) Config ¶
func (p *GlossaryPlugin) Config() *GlossaryConfig
Config returns the current glossary configuration.
func (*GlossaryPlugin) Configure ¶
func (p *GlossaryPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*GlossaryPlugin) Name ¶
func (p *GlossaryPlugin) Name() string
Name returns the unique name of the plugin.
func (*GlossaryPlugin) Priority ¶
func (p *GlossaryPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin priority for the given stage. Glossary should run late in render (post_render) to process article_html.
func (*GlossaryPlugin) Render ¶
func (p *GlossaryPlugin) Render(m *lifecycle.Manager) error
Render processes glossary terms and links them in post content.
func (*GlossaryPlugin) SetConfig ¶
func (p *GlossaryPlugin) SetConfig(config *GlossaryConfig)
SetConfig sets the glossary configuration.
func (*GlossaryPlugin) Terms ¶
func (p *GlossaryPlugin) Terms() []*GlossaryTerm
Terms returns a copy of all glossary terms.
type GlossaryTerm ¶
type GlossaryTerm struct {
// Term is the primary term name
Term string `json:"term"`
// Slug is the URL-safe identifier
Slug string `json:"slug"`
// Description is the term description
Description string `json:"description"`
// Aliases are alternative names for the term
Aliases []string `json:"aliases,omitempty"`
// Href is the URL path to the term's page
Href string `json:"href"`
// contains filtered or unexported fields
}
GlossaryTerm represents a single glossary term with its definition.
type HeadingAnchorsPlugin ¶
type HeadingAnchorsPlugin struct {
// contains filtered or unexported fields
}
HeadingAnchorsPlugin adds anchor links to headings in rendered HTML. It processes article_html during the render stage, after render_markdown.
func NewHeadingAnchorsPlugin ¶
func NewHeadingAnchorsPlugin() *HeadingAnchorsPlugin
NewHeadingAnchorsPlugin creates a new HeadingAnchorsPlugin with default settings.
func (*HeadingAnchorsPlugin) Configure ¶
func (p *HeadingAnchorsPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected in config.Extra["heading_anchors"] as a map.
func (*HeadingAnchorsPlugin) Name ¶
func (p *HeadingAnchorsPlugin) Name() string
Name returns the unique name of the plugin.
func (*HeadingAnchorsPlugin) Priority ¶
func (p *HeadingAnchorsPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for the render stage. Returns a positive priority to run after render_markdown.
func (*HeadingAnchorsPlugin) Render ¶
func (p *HeadingAnchorsPlugin) Render(m *lifecycle.Manager) error
Render processes article_html and adds anchor links to headings. Posts with Skip=true or empty ArticleHTML are skipped.
func (*HeadingAnchorsPlugin) SetClass ¶
func (p *HeadingAnchorsPlugin) SetClass(class string)
SetClass sets the anchor link CSS class.
func (*HeadingAnchorsPlugin) SetEnabled ¶
func (p *HeadingAnchorsPlugin) SetEnabled(enabled bool)
SetEnabled enables or disables the plugin.
func (*HeadingAnchorsPlugin) SetLevelRange ¶
func (p *HeadingAnchorsPlugin) SetLevelRange(minLevel, maxLevel int)
SetLevelRange sets the minimum and maximum heading levels to process.
func (*HeadingAnchorsPlugin) SetPosition ¶
func (p *HeadingAnchorsPlugin) SetPosition(position string)
SetPosition sets the anchor position ("start" or "end").
func (*HeadingAnchorsPlugin) SetSymbol ¶
func (p *HeadingAnchorsPlugin) SetSymbol(symbol string)
SetSymbol sets the anchor link symbol.
type ImageZoomPlugin ¶ added in v0.6.0
type ImageZoomPlugin struct {
// contains filtered or unexported fields
}
ImageZoomPlugin adds optional image zoom/lightbox functionality using GLightbox. It runs at the render stage (post_render, after markdown conversion) to add data-zoomable attributes to images, and at the write stage to inject the required JavaScript and CSS.
func NewImageZoomPlugin ¶ added in v0.6.0
func NewImageZoomPlugin() *ImageZoomPlugin
NewImageZoomPlugin creates a new ImageZoomPlugin with default settings.
func (*ImageZoomPlugin) Config ¶ added in v0.6.0
func (p *ImageZoomPlugin) Config() models.ImageZoomConfig
Config returns the current image zoom configuration.
func (*ImageZoomPlugin) Configure ¶ added in v0.6.0
func (p *ImageZoomPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "image_zoom" key.
func (*ImageZoomPlugin) Name ¶ added in v0.6.0
func (p *ImageZoomPlugin) Name() string
Name returns the unique name of the plugin.
func (*ImageZoomPlugin) Priority ¶ added in v0.6.0
func (p *ImageZoomPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs after render_markdown (which has default priority 0) but BEFORE templates (which uses PriorityLate=100) so that glightbox_enabled is set in config.Extra before templates renders the HTML.
func (*ImageZoomPlugin) Render ¶ added in v0.6.0
func (p *ImageZoomPlugin) Render(m *lifecycle.Manager) error
Render processes images in the rendered HTML for all posts. It adds data-glightbox attributes to images that should be zoomable.
func (*ImageZoomPlugin) SetConfig ¶ added in v0.6.0
func (p *ImageZoomPlugin) SetConfig(config models.ImageZoomConfig)
SetConfig sets the image zoom configuration directly. This is useful for testing or programmatic configuration.
type InlineAttributeTransformer ¶ added in v0.6.0
type InlineAttributeTransformer struct{}
InlineAttributeTransformer is a Goldmark AST transformer that handles inline attribute syntax for images and links.
This extends Goldmark's built-in attribute support (which only works for block-level elements like headings) to also work with inline elements.
Supported syntax:
- {.classname} - adds a CSS class
- {#idname} - adds an id attribute
- {.class1 .class2} - multiple classes
- {#id .class} - id and class combined
Example usage:
{.more-cinematic}
[link text](url){.external-link}
func (*InlineAttributeTransformer) Transform ¶ added in v0.6.0
func (t *InlineAttributeTransformer) Transform(node *ast.Document, reader text.Reader, _ parser.Context)
Transform implements parser.ASTTransformer. It walks the AST looking for inline elements (images, links) followed by text nodes containing attribute syntax, and applies those attributes to the preceding element.
type JSONFeed ¶
type JSONFeed struct {
Version string `json:"version"`
Title string `json:"title"`
HomePageURL string `json:"home_page_url,omitempty"`
FeedURL string `json:"feed_url,omitempty"`
Description string `json:"description,omitempty"`
UserComment string `json:"user_comment,omitempty"`
NextURL string `json:"next_url,omitempty"`
Icon string `json:"icon,omitempty"`
Favicon string `json:"favicon,omitempty"`
Authors []JSONFeedAuthor `json:"authors,omitempty"`
Language string `json:"language,omitempty"`
Expired bool `json:"expired,omitempty"`
Items []JSONFeedItem `json:"items"`
}
JSONFeed represents a JSON Feed 1.1 document. See https://jsonfeed.org/version/1.1
type JSONFeedAuthor ¶
type JSONFeedAuthor struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Avatar string `json:"avatar,omitempty"`
}
JSONFeedAuthor represents an author in a JSON Feed.
type JSONFeedItem ¶
type JSONFeedItem struct {
ID string `json:"id"`
URL string `json:"url,omitempty"`
ExternalURL string `json:"external_url,omitempty"`
Title string `json:"title,omitempty"`
ContentHTML string `json:"content_html,omitempty"`
ContentText string `json:"content_text,omitempty"`
Summary string `json:"summary,omitempty"`
Image string `json:"image,omitempty"`
BannerImage string `json:"banner_image,omitempty"`
DatePublished string `json:"date_published,omitempty"`
DateModified string `json:"date_modified,omitempty"`
Authors []JSONFeedAuthor `json:"authors,omitempty"`
Tags []string `json:"tags,omitempty"`
Language string `json:"language,omitempty"`
}
JSONFeedItem represents an item in a JSON Feed.
type JinjaMdPlugin ¶
type JinjaMdPlugin struct {
// contains filtered or unexported fields
}
JinjaMdPlugin processes Jinja2 templates in markdown content. This allows using template syntax within markdown files before they are converted to HTML. It operates during the transform stage.
Posts must have `jinja: true` in their frontmatter to be processed.
Available template variables:
- post: The current post object
- config: The site configuration
- posts: All posts (via core.Posts())
- core: The lifecycle manager (for filter/map operations)
func NewJinjaMdPlugin ¶
func NewJinjaMdPlugin() *JinjaMdPlugin
NewJinjaMdPlugin creates a new jinja_md plugin.
func (*JinjaMdPlugin) Configure ¶
func (p *JinjaMdPlugin) Configure(m *lifecycle.Manager) error
Configure initializes the template engine. If the templates plugin has already initialized an engine, reuse it.
func (*JinjaMdPlugin) Engine ¶
func (p *JinjaMdPlugin) Engine() *templates.Engine
Engine returns the template engine for use by other plugins.
type Keys ¶ added in v0.6.0
type Keys struct {
ast.BaseInline
// KeySequence holds the individual keys (e.g., ["Ctrl", "Alt", "Del"])
KeySequence []string
}
Keys is an AST node representing keyboard keys (++Ctrl+Alt+Del++).
type KeysExtension ¶ added in v0.6.0
type KeysExtension struct{}
KeysExtension is a goldmark extension for keyboard keys syntax.
func (*KeysExtension) Extend ¶ added in v0.6.0
func (e *KeysExtension) Extend(m goldmark.Markdown)
Extend adds the keys parser and renderer to goldmark.
type LeaderboardEntry ¶ added in v0.6.0
type LeaderboardEntry struct {
Post *models.Post `json:"post"`
Href string `json:"href"`
Title string `json:"title"`
Likes int `json:"likes"`
Reposts int `json:"reposts"`
Replies int `json:"replies"`
Bookmarks int `json:"bookmarks"`
Mentions int `json:"mentions"`
Total int `json:"total"`
}
LeaderboardEntry represents a post with its webmention counts.
type LinkCollectorPlugin ¶
type LinkCollectorPlugin struct {
// contains filtered or unexported fields
}
LinkCollectorPlugin collects all hyperlinks from posts and tracks inlinks (pages linking TO a post) and outlinks (pages a post links TO). It runs in the render stage after render_markdown.
func NewLinkCollectorPlugin ¶
func NewLinkCollectorPlugin() *LinkCollectorPlugin
NewLinkCollectorPlugin creates a new LinkCollectorPlugin with default settings.
func (*LinkCollectorPlugin) Configure ¶
func (p *LinkCollectorPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*LinkCollectorPlugin) Name ¶
func (p *LinkCollectorPlugin) Name() string
Name returns the unique name of the plugin.
func (*LinkCollectorPlugin) Priority ¶
func (p *LinkCollectorPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for the render stage. Returns a late priority to ensure it runs after render_markdown.
func (*LinkCollectorPlugin) Render ¶
func (p *LinkCollectorPlugin) Render(m *lifecycle.Manager) error
Render collects all links from posts and populates inlinks/outlinks.
func (*LinkCollectorPlugin) SetIncludeFeeds ¶
func (p *LinkCollectorPlugin) SetIncludeFeeds(include bool)
SetIncludeFeeds enables or disables including feed pages in inlinks.
func (*LinkCollectorPlugin) SetIncludeIndex ¶
func (p *LinkCollectorPlugin) SetIncludeIndex(include bool)
SetIncludeIndex enables or disables including the index page in inlinks.
func (*LinkCollectorPlugin) SetSiteURL ¶
func (p *LinkCollectorPlugin) SetSiteURL(siteURL string)
SetSiteURL sets the site URL for determining internal vs external links.
type LoadPlugin ¶
type LoadPlugin struct{}
LoadPlugin parses markdown files into Post objects.
type MDVideoPlugin ¶
type MDVideoPlugin struct {
// contains filtered or unexported fields
}
MDVideoPlugin converts markdown image syntax for video files into HTML video elements. It runs at the render stage (late priority, after markdown conversion).
Example input (markdown):

Example output (HTML):
<video autoplay loop muted playsinline controls class="md-video"> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
func NewMDVideoPlugin ¶
func NewMDVideoPlugin() *MDVideoPlugin
NewMDVideoPlugin creates a new MDVideoPlugin with default settings.
func (*MDVideoPlugin) Config ¶
func (p *MDVideoPlugin) Config() models.MDVideoConfig
Config returns the current md_video configuration.
func (*MDVideoPlugin) Configure ¶
func (p *MDVideoPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "md_video" key.
func (*MDVideoPlugin) Name ¶
func (p *MDVideoPlugin) Name() string
Name returns the unique name of the plugin.
func (*MDVideoPlugin) Priority ¶
func (p *MDVideoPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs after render_markdown (which has default priority 0).
func (*MDVideoPlugin) Render ¶
func (p *MDVideoPlugin) Render(m *lifecycle.Manager) error
Render processes video image tags in the rendered HTML for all posts.
func (*MDVideoPlugin) SetConfig ¶
func (p *MDVideoPlugin) SetConfig(config models.MDVideoConfig)
SetConfig sets the md_video configuration directly. This is useful for testing or programmatic configuration.
type Mark ¶ added in v0.6.0
type Mark struct {
ast.BaseInline
}
Mark is an AST node representing highlighted text (==text==).
type MarkExtension ¶ added in v0.6.0
type MarkExtension struct{}
MarkExtension is a goldmark extension for mark (highlight) syntax.
func (*MarkExtension) Extend ¶ added in v0.6.0
func (e *MarkExtension) Extend(m goldmark.Markdown)
Extend adds the mark parser and renderer to goldmark.
type MentionAuthor ¶ added in v0.5.0
type MentionAuthor struct {
Name string `json:"name,omitempty"`
Photo string `json:"photo,omitempty"`
URL string `json:"url,omitempty"`
}
MentionAuthor represents the author of a webmention.
type MentionContent ¶ added in v0.5.0
type MentionContent struct {
Text string `json:"text,omitempty"`
HTML string `json:"html,omitempty"`
}
MentionContent represents the content of a webmention.
type MentionSource ¶ added in v0.5.0
type MentionSource int
MentionSource represents the detected source platform of a webmention.
const ( // SourceWeb is a standard web webmention SourceWeb MentionSource = iota // SourceBridgyBluesky is a Bluesky mention via Bridgy SourceBridgyBluesky // SourceBridgyTwitter is a Twitter mention via Bridgy SourceBridgyTwitter // SourceBridgyMastodon is a Mastodon mention via Bridgy SourceBridgyMastodon // SourceBridgyGitHub is a GitHub mention via Bridgy SourceBridgyGitHub // SourceBridgyFlickr is a Flickr mention via Bridgy SourceBridgyFlickr // SourceCustomBridge is a mention from a custom bridge SourceCustomBridge )
func (MentionSource) String ¶ added in v0.5.0
func (s MentionSource) String() string
String returns the string representation of MentionSource.
type MentionsPlugin ¶ added in v0.5.0
type MentionsPlugin struct {
// contains filtered or unexported fields
}
MentionsPlugin transforms @handle syntax into HTML links by resolving handles against blogroll entries.
func NewMentionsPlugin ¶ added in v0.5.0
func NewMentionsPlugin() *MentionsPlugin
NewMentionsPlugin creates a new MentionsPlugin.
func (*MentionsPlugin) Configure ¶ added in v0.5.0
func (p *MentionsPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*MentionsPlugin) Name ¶ added in v0.5.0
func (p *MentionsPlugin) Name() string
Name returns the unique name of the plugin.
type MermaidPlugin ¶
type MermaidPlugin struct {
// contains filtered or unexported fields
}
MermaidPlugin converts Mermaid code blocks into rendered diagrams. It runs at the render stage (post_render, after markdown conversion).
func NewMermaidPlugin ¶
func NewMermaidPlugin() *MermaidPlugin
NewMermaidPlugin creates a new MermaidPlugin with default settings.
func (*MermaidPlugin) Config ¶
func (p *MermaidPlugin) Config() models.MermaidConfig
Config returns the current mermaid configuration.
func (*MermaidPlugin) Configure ¶
func (p *MermaidPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "mermaid" key.
func (*MermaidPlugin) Name ¶
func (p *MermaidPlugin) Name() string
Name returns the unique name of the plugin.
func (*MermaidPlugin) Priority ¶
func (p *MermaidPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs after render_markdown (which has default priority 0).
func (*MermaidPlugin) Render ¶
func (p *MermaidPlugin) Render(m *lifecycle.Manager) error
Render processes mermaid code blocks in the rendered HTML for all posts.
func (*MermaidPlugin) SetConfig ¶
func (p *MermaidPlugin) SetConfig(config models.MermaidConfig)
SetConfig sets the mermaid configuration directly. This is useful for testing or programmatic configuration.
type OGMetadata ¶ added in v0.5.0
type OGMetadata struct {
Title string `json:"title"`
Description string `json:"description"`
Image string `json:"image"`
SiteName string `json:"site_name"`
Type string `json:"type"`
FetchedAt int64 `json:"fetched_at"`
}
OGMetadata holds Open Graph metadata for external embeds.
type OneLineLinkPlugin ¶ added in v0.2.0
type OneLineLinkPlugin struct {
// contains filtered or unexported fields
}
OneLineLinkPlugin expands URLs that appear alone in a paragraph into rich preview cards. It runs at the render stage (after markdown conversion).
func NewOneLineLinkPlugin ¶ added in v0.2.0
func NewOneLineLinkPlugin() *OneLineLinkPlugin
NewOneLineLinkPlugin creates a new OneLineLinkPlugin with default settings.
func (*OneLineLinkPlugin) Config ¶ added in v0.2.0
func (p *OneLineLinkPlugin) Config() models.OneLineLinkConfig
Config returns the current plugin configuration.
func (*OneLineLinkPlugin) Configure ¶ added in v0.2.0
func (p *OneLineLinkPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "one_line_link" key.
func (*OneLineLinkPlugin) Name ¶ added in v0.2.0
func (p *OneLineLinkPlugin) Name() string
Name returns the unique name of the plugin.
func (*OneLineLinkPlugin) Priority ¶ added in v0.2.0
func (p *OneLineLinkPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs after render_markdown (which has default priority 0).
func (*OneLineLinkPlugin) Render ¶ added in v0.2.0
func (p *OneLineLinkPlugin) Render(m *lifecycle.Manager) error
Render processes paragraphs containing only URLs in the rendered HTML.
func (*OneLineLinkPlugin) SetConfig ¶ added in v0.2.0
func (p *OneLineLinkPlugin) SetConfig(config models.OneLineLinkConfig)
SetConfig sets the plugin configuration directly. This is useful for testing or programmatic configuration.
type OverwriteCheckPlugin ¶ added in v0.3.0
type OverwriteCheckPlugin struct {
// contains filtered or unexported fields
}
OverwriteCheckPlugin detects when multiple posts or feeds would write to the same output path, preventing accidental content overwrites.
func NewOverwriteCheckPlugin ¶ added in v0.3.0
func NewOverwriteCheckPlugin() *OverwriteCheckPlugin
NewOverwriteCheckPlugin creates a new OverwriteCheckPlugin.
func (*OverwriteCheckPlugin) Collect ¶ added in v0.3.0
func (p *OverwriteCheckPlugin) Collect(m *lifecycle.Manager) error
Collect checks for output path conflicts between posts and feeds.
func (*OverwriteCheckPlugin) Conflicts ¶ added in v0.3.0
func (p *OverwriteCheckPlugin) Conflicts() []PathConflict
Conflicts returns the detected path conflicts.
func (*OverwriteCheckPlugin) Name ¶ added in v0.3.0
func (p *OverwriteCheckPlugin) Name() string
Name returns the unique name of the plugin.
func (*OverwriteCheckPlugin) Priority ¶ added in v0.3.0
func (p *OverwriteCheckPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin execution priority for the given stage. Run before other collect plugins to catch conflicts early.
func (*OverwriteCheckPlugin) SetWarnOnly ¶ added in v0.3.0
func (p *OverwriteCheckPlugin) SetWarnOnly(warnOnly bool)
SetWarnOnly configures whether to warn or fail on conflicts.
type PagefindInstallError ¶ added in v0.3.0
PagefindInstallError indicates an error during Pagefind installation.
func NewPagefindInstallError ¶ added in v0.3.0
func NewPagefindInstallError(operation, message string, err error) *PagefindInstallError
NewPagefindInstallError creates a new PagefindInstallError.
func (*PagefindInstallError) Error ¶ added in v0.3.0
func (e *PagefindInstallError) Error() string
func (*PagefindInstallError) Unwrap ¶ added in v0.3.0
func (e *PagefindInstallError) Unwrap() error
type PagefindInstaller ¶ added in v0.3.0
type PagefindInstaller struct {
// CacheDir is the directory where binaries are cached.
CacheDir string
// Version is the Pagefind version to install (e.g., "v1.4.0" or "latest").
Version string
// Verbose enables verbose output during installation.
Verbose bool
// contains filtered or unexported fields
}
PagefindInstaller handles automatic downloading and caching of Pagefind binaries.
func NewPagefindInstaller ¶ added in v0.3.0
func NewPagefindInstaller() *PagefindInstaller
NewPagefindInstaller creates a new PagefindInstaller with default settings.
func NewPagefindInstallerWithConfig ¶ added in v0.3.0
func NewPagefindInstallerWithConfig(config PagefindInstallerConfig) *PagefindInstaller
NewPagefindInstallerWithConfig creates a new PagefindInstaller from config.
func (*PagefindInstaller) GetCacheDir ¶ added in v0.3.0
func (i *PagefindInstaller) GetCacheDir() (string, error)
GetCacheDir returns the cache directory, creating it if necessary.
func (*PagefindInstaller) GetCachedBinaryPath ¶ added in v0.3.0
func (i *PagefindInstaller) GetCachedBinaryPath(version string) (string, error)
GetCachedBinaryPath returns the path to a cached Pagefind binary for the given version.
func (*PagefindInstaller) GetLatestVersion ¶ added in v0.3.0
func (i *PagefindInstaller) GetLatestVersion() (string, error)
GetLatestVersion fetches the latest Pagefind version from GitHub releases. It follows redirect chains (e.g., repo renames) until it finds the final URL with the version tag.
func (*PagefindInstaller) Install ¶ added in v0.3.0
func (i *PagefindInstaller) Install() (string, error)
Install downloads and caches the Pagefind binary for the current platform. Returns the path to the installed binary.
func (*PagefindInstaller) IsCached ¶ added in v0.3.0
func (i *PagefindInstaller) IsCached(version string) (bool, error)
IsCached checks if a specific version is already cached and valid.
func (*PagefindInstaller) ResolveVersion ¶ added in v0.3.0
func (i *PagefindInstaller) ResolveVersion() (string, error)
ResolveVersion resolves "latest" to an actual version number.
type PagefindInstallerConfig ¶ added in v0.3.0
type PagefindInstallerConfig struct {
// AutoInstall enables automatic Pagefind installation (default: true).
AutoInstall *bool `json:"auto_install,omitempty" yaml:"auto_install,omitempty" toml:"auto_install,omitempty"`
// Version is the Pagefind version to install (default: "latest").
Version string `json:"version,omitempty" yaml:"version,omitempty" toml:"version,omitempty"`
// CacheDir is the directory for caching binaries (default: ~/.markata-go/bin/).
CacheDir string `json:"cache_dir,omitempty" yaml:"cache_dir,omitempty" toml:"cache_dir,omitempty"`
}
PagefindInstallerConfig configures the Pagefind installer.
func NewPagefindInstallerConfig ¶ added in v0.3.0
func NewPagefindInstallerConfig() PagefindInstallerConfig
NewPagefindInstallerConfig creates a new PagefindInstallerConfig with default values.
func (*PagefindInstallerConfig) IsAutoInstallEnabled ¶ added in v0.3.0
func (c *PagefindInstallerConfig) IsAutoInstallEnabled() bool
IsAutoInstallEnabled returns whether auto-install is enabled. Defaults to true if not explicitly set.
type PagefindPlugin ¶ added in v0.3.0
type PagefindPlugin struct{}
PagefindPlugin runs Pagefind to generate a search index after all HTML files are written. Pagefind is a static site search tool that creates an optimized search index that can be queried entirely client-side.
This plugin runs in the Cleanup stage with PriorityLast to ensure all HTML files have been written before indexing begins.
For more information about Pagefind, see: https://pagefind.app/
func NewPagefindPlugin ¶ added in v0.3.0
func NewPagefindPlugin() *PagefindPlugin
NewPagefindPlugin creates a new PagefindPlugin.
func (*PagefindPlugin) Cleanup ¶ added in v0.3.0
func (p *PagefindPlugin) Cleanup(m *lifecycle.Manager) error
Cleanup runs Pagefind to index the generated site. This runs after all HTML files have been written in the Write stage. On incremental builds with few changes, Pagefind is skipped for speed.
func (*PagefindPlugin) Name ¶ added in v0.3.0
func (p *PagefindPlugin) Name() string
Name returns the unique name of the plugin.
type PaletteCSSPlugin ¶
type PaletteCSSPlugin struct{}
PaletteCSSPlugin generates CSS variables from the configured color palette. It runs during the Write stage and creates/overwrites css/variables.css with the palette's CSS custom properties. It runs after static_assets to overwrite the default variables.css with palette-specific values.
The plugin supports intelligent light/dark palette mapping: - palette = "everforest" will auto-detect everforest-light and everforest-dark - palette_light and palette_dark can override the auto-detected variants
The plugin maps palette colors to the theme's expected CSS variable names, preserving fonts, spacing, and other non-color variables from the default theme.
func NewPaletteCSSPlugin ¶
func NewPaletteCSSPlugin() *PaletteCSSPlugin
NewPaletteCSSPlugin creates a new PaletteCSSPlugin.
func (*PaletteCSSPlugin) Name ¶
func (p *PaletteCSSPlugin) Name() string
Name returns the unique name of the plugin.
type PaletteManifestEntry ¶ added in v0.6.0
type PaletteManifestEntry struct {
Name string `json:"name"`
DisplayName string `json:"displayName"`
Variant string `json:"variant"`
BaseName string `json:"baseName"`
}
PaletteManifestEntry represents a palette entry in the manifest.
type PathConflict ¶ added in v0.3.0
type PathConflict struct {
// OutputPath is the conflicting output path
OutputPath string
// Sources are the content sources (posts, feeds) that conflict
Sources []string
}
PathConflict represents a conflict between two content sources that would result in the same output path.
type PostStats ¶ added in v0.5.0
type PostStats struct {
// WordCount is the number of words in the post
WordCount int `json:"word_count"`
// CharCount is the number of characters (excluding whitespace)
CharCount int `json:"char_count"`
// ReadingTime is the estimated reading time in minutes
ReadingTime int `json:"reading_time"`
// ReadingTimeText is a formatted reading time string
ReadingTimeText string `json:"reading_time_text"`
// CodeLines is the number of lines of code in code blocks
CodeLines int `json:"code_lines"`
// CodeBlocks is the number of code blocks in the post
CodeBlocks int `json:"code_blocks"`
}
PostStats contains calculated statistics for a single post.
type PrevNextPlugin ¶
type PrevNextPlugin struct{}
PrevNextPlugin calculates previous/next post links for navigation. It runs in the collect stage after feeds have been created.
func NewPrevNextPlugin ¶
func NewPrevNextPlugin() *PrevNextPlugin
NewPrevNextPlugin creates a new PrevNextPlugin.
func (*PrevNextPlugin) Collect ¶
func (p *PrevNextPlugin) Collect(m *lifecycle.Manager) error
Collect calculates prev/next links for all posts based on the configured strategy.
func (*PrevNextPlugin) Name ¶
func (p *PrevNextPlugin) Name() string
Name returns the unique name of the plugin.
type PublishFeedsPlugin ¶
type PublishFeedsPlugin struct {
// contains filtered or unexported fields
}
PublishFeedsPlugin writes feeds to multiple output formats during the write stage. It also registers synthetic posts in the Configure stage so they can be resolved by wikilinks.
func NewPublishFeedsPlugin ¶
func NewPublishFeedsPlugin() *PublishFeedsPlugin
NewPublishFeedsPlugin creates a new PublishFeedsPlugin.
func (*PublishFeedsPlugin) Configure ¶ added in v0.6.0
func (p *PublishFeedsPlugin) Configure(m *lifecycle.Manager) error
Configure registers synthetic posts for feed pages so they can be resolved by wikilinks. These posts are marked with Skip: true so they don't interfere with normal rendering.
func (*PublishFeedsPlugin) Name ¶
func (p *PublishFeedsPlugin) Name() string
Name returns the unique name of the plugin.
func (*PublishFeedsPlugin) Write ¶
func (p *PublishFeedsPlugin) Write(m *lifecycle.Manager) error
Write generates and writes feed files in all configured formats. Feed generation is parallelized for better performance with many feeds. Uses incremental build cache to skip feeds with unchanged content.
type PublishHTMLPlugin ¶
type PublishHTMLPlugin struct {
// contains filtered or unexported fields
}
PublishHTMLPlugin writes individual post HTML files during the write stage. It supports multiple output formats: HTML, Markdown source, and OG card HTML.
func NewPublishHTMLPlugin ¶
func NewPublishHTMLPlugin() *PublishHTMLPlugin
NewPublishHTMLPlugin creates a new PublishHTMLPlugin.
func (*PublishHTMLPlugin) Name ¶
func (p *PublishHTMLPlugin) Name() string
Name returns the unique name of the plugin.
type QRCodePlugin ¶ added in v0.2.0
type QRCodePlugin struct {
// contains filtered or unexported fields
}
QRCodePlugin generates QR code images for each post's URL. It runs at the write stage to generate QR code files.
func NewQRCodePlugin ¶ added in v0.2.0
func NewQRCodePlugin() *QRCodePlugin
NewQRCodePlugin creates a new QRCodePlugin with default settings.
func (*QRCodePlugin) Config ¶ added in v0.2.0
func (p *QRCodePlugin) Config() models.QRCodeConfig
Config returns the current plugin configuration.
func (*QRCodePlugin) Configure ¶ added in v0.2.0
func (p *QRCodePlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "qrcode" key.
func (*QRCodePlugin) Name ¶ added in v0.2.0
func (p *QRCodePlugin) Name() string
Name returns the unique name of the plugin.
func (*QRCodePlugin) Priority ¶ added in v0.2.0
func (p *QRCodePlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs late in write stage to ensure all post data is finalized.
func (*QRCodePlugin) SetBaseURL ¶ added in v0.2.0
func (p *QRCodePlugin) SetBaseURL(url string)
SetBaseURL sets the base URL for testing.
func (*QRCodePlugin) SetConfig ¶ added in v0.2.0
func (p *QRCodePlugin) SetConfig(config models.QRCodeConfig)
SetConfig sets the plugin configuration directly. This is useful for testing or programmatic configuration.
func (*QRCodePlugin) SetOutputDir ¶ added in v0.2.0
func (p *QRCodePlugin) SetOutputDir(dir string)
SetOutputDir sets the output directory for testing.
type RSS ¶
type RSS struct {
XMLName xml.Name `xml:"rss"`
Version string `xml:"version,attr"`
Atom string `xml:"xmlns:atom,attr,omitempty"`
Channel RSSChannel `xml:"channel"`
}
RSS represents an RSS 2.0 feed.
type RSSChannel ¶
type RSSChannel struct {
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
Language string `xml:"language,omitempty"`
LastBuildDate string `xml:"lastBuildDate,omitempty"`
AtomLink *AtomLink `xml:"atom:link,omitempty"`
Items []RSSItem `xml:"item"`
}
RSSChannel represents the channel element in an RSS feed.
type RSSItem ¶
type RSSItem struct {
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
PubDate string `xml:"pubDate,omitempty"`
GUID RSSGUID `xml:"guid"`
Author string `xml:"author,omitempty"`
}
RSSItem represents an item element in an RSS feed.
type ReadingTimePlugin ¶
type ReadingTimePlugin struct {
// contains filtered or unexported fields
}
ReadingTimePlugin calculates the word count and estimated reading time for each post during the transform stage.
func NewReadingTimePlugin ¶
func NewReadingTimePlugin() *ReadingTimePlugin
NewReadingTimePlugin creates a new ReadingTimePlugin with default settings.
func (*ReadingTimePlugin) Configure ¶
func (p *ReadingTimePlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*ReadingTimePlugin) Name ¶
func (p *ReadingTimePlugin) Name() string
Name returns the unique name of the plugin.
func (*ReadingTimePlugin) SetWordsPerMinute ¶
func (p *ReadingTimePlugin) SetWordsPerMinute(wpm int)
SetWordsPerMinute sets the average reading speed.
type ReadingTimeResult ¶
type ReadingTimeResult struct {
// WordCount is the number of words in the post
WordCount int `json:"word_count"`
// ReadingTime is the estimated reading time in minutes
ReadingTime int `json:"reading_time"`
// ReadingTimeText is a formatted reading time string
ReadingTimeText string `json:"reading_time_text"`
}
ReadingTimeResult holds the calculated reading metrics for a post.
func GetReadingTime ¶
func GetReadingTime(post *models.Post) *ReadingTimeResult
GetReadingTime extracts reading time data from a post's Extra map. Returns nil if reading time hasn't been calculated.
type ReceivedWebMention ¶ added in v0.5.0
type ReceivedWebMention struct {
// Standard webmention.io fields
URL string `json:"url"`
Source string `json:"wm-source"`
Target string `json:"wm-target"`
Published string `json:"published,omitempty"`
WMProperty string `json:"wm-property"`
// Author information
Author MentionAuthor `json:"author,omitempty"`
// Content information
Content MentionContent `json:"content,omitempty"`
// Bridging metadata (enriched by detection)
SourceSite MentionSource `json:"source_site,omitempty"`
Platform string `json:"platform,omitempty"`
Handle string `json:"handle,omitempty"`
OriginalURL string `json:"original_url,omitempty"`
}
ReceivedWebMention represents an incoming webmention with bridging metadata.
func (*ReceivedWebMention) InteractionType ¶ added in v0.5.0
func (m *ReceivedWebMention) InteractionType() string
InteractionType returns the interaction type based on wm-property.
type Redirect ¶
type Redirect struct {
// Original is the source path (the old URL).
Original string
// New is the destination path (the new URL).
New string
}
Redirect represents a single URL redirect rule.
type RedirectsConfig ¶
type RedirectsConfig struct {
// RedirectsFile is the path to the _redirects file.
// Default: "static/_redirects"
RedirectsFile string
// RedirectTemplate is an optional path to a custom template.
// If empty, the default template is used.
RedirectTemplate string
}
RedirectsConfig holds configuration for the redirects plugin.
type RedirectsPlugin ¶
type RedirectsPlugin struct {
// contains filtered or unexported fields
}
RedirectsPlugin generates HTML redirect pages from a _redirects file. It creates index.html files at each source path that redirect to the destination.
func NewRedirectsPlugin ¶
func NewRedirectsPlugin() *RedirectsPlugin
NewRedirectsPlugin creates a new RedirectsPlugin with default configuration.
func (*RedirectsPlugin) Configure ¶
func (p *RedirectsPlugin) Configure(m *lifecycle.Manager) error
Configure loads plugin configuration from the manager.
func (*RedirectsPlugin) GetConfig ¶
func (p *RedirectsPlugin) GetConfig() RedirectsConfig
GetConfig returns the current plugin configuration.
func (*RedirectsPlugin) Name ¶
func (p *RedirectsPlugin) Name() string
Name returns the unique name of the plugin.
func (*RedirectsPlugin) Priority ¶
func (p *RedirectsPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin priority for the given stage. Redirects should run late in the write stage, after content is written.
func (*RedirectsPlugin) SetConfig ¶
func (p *RedirectsPlugin) SetConfig(config RedirectsConfig)
SetConfig allows setting the plugin configuration directly (useful for testing).
type RenderMarkdownPlugin ¶
type RenderMarkdownPlugin struct {
// contains filtered or unexported fields
}
RenderMarkdownPlugin converts markdown content to HTML using goldmark.
func NewRenderMarkdownPlugin ¶
func NewRenderMarkdownPlugin() *RenderMarkdownPlugin
NewRenderMarkdownPlugin creates a new RenderMarkdownPlugin with goldmark configured. The goldmark instance is configured with: - GFM extensions (tables, strikethrough, autolinks, task lists) - Syntax highlighting using chroma - HTML rendering with unsafe mode (allow raw HTML) - Auto heading IDs - Custom admonition support
The initial configuration uses a default theme. The Configure() method will reconfigure the markdown renderer with the appropriate theme based on the site's palette configuration.
func (*RenderMarkdownPlugin) Configure ¶
func (p *RenderMarkdownPlugin) Configure(m *lifecycle.Manager) error
Configure initializes the plugin during the configure stage. It reads the highlight theme from configuration, falling back to the theme derived from the site's color palette if not explicitly set.
Configuration priority: 1. markdown.highlight.theme in config (explicit override) 2. Theme derived from theme.palette (automatic matching) 3. Default theme based on palette variant (github/github-dark)
func (*RenderMarkdownPlugin) Name ¶
func (p *RenderMarkdownPlugin) Name() string
Name returns the unique name of the plugin.
func (*RenderMarkdownPlugin) Render ¶
func (p *RenderMarkdownPlugin) Render(m *lifecycle.Manager) error
Render converts markdown content to HTML for all posts. Posts with Skip=true are skipped. The rendered HTML is stored in post.ArticleHTML. Uses build cache to skip re-rendering unchanged content.
Uses two-phase processing for incremental optimization: Phase 1: Quick single-threaded pass to restore cached HTML (no worker overhead) Phase 2: Concurrent processing only for posts that need rendering
type SiteStats ¶ added in v0.5.0
type SiteStats struct {
// TotalPosts is the total number of posts on the site
TotalPosts int `json:"total_posts"`
// TotalWords is the sum of word counts across all posts
TotalWords int `json:"total_words"`
// TotalChars is the sum of character counts
TotalChars int `json:"total_chars"`
// TotalReadingTime is the total reading time in minutes
TotalReadingTime int `json:"total_reading_time"`
// TotalReadingTimeText is formatted total reading time
TotalReadingTimeText string `json:"total_reading_time_text"`
// AverageWords is the average word count per post
AverageWords int `json:"average_words"`
// AverageReadingTime is the average reading time per post
AverageReadingTime int `json:"average_reading_time"`
// AverageReadingTimeText is formatted average reading time
AverageReadingTimeText string `json:"average_reading_time_text"`
// TotalCodeLines is the total lines of code across the site
TotalCodeLines int `json:"total_code_lines"`
// TotalCodeBlocks is the total number of code blocks
TotalCodeBlocks int `json:"total_code_blocks"`
// PostsByYear maps year to post count
PostsByYear map[int]int `json:"posts_by_year"`
// WordsByYear maps year to total word count
WordsByYear map[int]int `json:"words_by_year"`
// PostsByTag maps tag name to post count
PostsByTag map[string]int `json:"posts_by_tag"`
}
SiteStats contains global statistics across all posts.
func GetSiteStats ¶ added in v0.5.0
GetSiteStats retrieves site-wide statistics from the cache.
type SitemapPlugin ¶
type SitemapPlugin struct{}
SitemapPlugin generates a sitemap.xml file during the write stage. The sitemap includes all published posts and feed index pages.
func NewSitemapPlugin ¶
func NewSitemapPlugin() *SitemapPlugin
NewSitemapPlugin creates a new SitemapPlugin.
func (*SitemapPlugin) Name ¶
func (p *SitemapPlugin) Name() string
Name returns the unique name of the plugin.
type SitemapURL ¶
type SitemapURL struct {
Loc string `xml:"loc"`
LastMod string `xml:"lastmod,omitempty"`
ChangeFreq string `xml:"changefreq,omitempty"`
Priority string `xml:"priority,omitempty"`
}
SitemapURL represents a single URL entry in the sitemap.
type SlugConflict ¶ added in v0.6.0
type SlugConflict struct {
// Slug is the conflicting slug (empty string means homepage)
Slug string
// Sources describes the conflicting content sources
Sources []string
// ConflictType indicates the type of conflict
ConflictType string // "post-post", "post-feed"
}
SlugConflict represents a conflict between content sources that resolve to the same slug.
type SlugConflictError ¶ added in v0.6.0
type SlugConflictError struct {
Message string
Conflicts []SlugConflict
}
SlugConflictError is a critical error about slug conflicts. It implements lifecycle.CriticalError to ensure the build fails.
func (*SlugConflictError) Error ¶ added in v0.6.0
func (e *SlugConflictError) Error() string
Error implements the error interface.
func (*SlugConflictError) IsCritical ¶ added in v0.6.0
func (e *SlugConflictError) IsCritical() bool
IsCritical marks this as a critical error that should halt the build.
type SlugConflictsPlugin ¶ added in v0.6.0
type SlugConflictsPlugin struct {
// contains filtered or unexported fields
}
SlugConflictsPlugin detects slug conflicts between posts and feeds. It runs during the Collect stage after posts are loaded and feeds are configured.
Conflicts detected:
- Multiple posts resolving to the same slug
- Post slug matching a feed slug
func NewSlugConflictsPlugin ¶ added in v0.6.0
func NewSlugConflictsPlugin() *SlugConflictsPlugin
NewSlugConflictsPlugin creates a new SlugConflictsPlugin.
func (*SlugConflictsPlugin) Collect ¶ added in v0.6.0
func (p *SlugConflictsPlugin) Collect(m *lifecycle.Manager) error
Collect checks for slug conflicts between posts and feeds.
func (*SlugConflictsPlugin) Conflicts ¶ added in v0.6.0
func (p *SlugConflictsPlugin) Conflicts() []SlugConflict
Conflicts returns the detected slug conflicts.
func (*SlugConflictsPlugin) Name ¶ added in v0.6.0
func (p *SlugConflictsPlugin) Name() string
Name returns the unique name of the plugin.
func (*SlugConflictsPlugin) Priority ¶ added in v0.6.0
func (p *SlugConflictsPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin execution priority for the given stage. Run very early in the collect stage to catch conflicts before other processing.
func (*SlugConflictsPlugin) SetEnabled ¶ added in v0.6.0
func (p *SlugConflictsPlugin) SetEnabled(enabled bool)
SetEnabled enables or disables the plugin.
type StaticAssetsPlugin ¶
type StaticAssetsPlugin struct{}
StaticAssetsPlugin copies static assets from themes and project directories to output. It handles: 1. Theme static files (themes/[theme]/static/*) 2. Project static files (static/*) Project files take precedence over theme files (local override).
func NewStaticAssetsPlugin ¶
func NewStaticAssetsPlugin() *StaticAssetsPlugin
NewStaticAssetsPlugin creates a new StaticAssetsPlugin.
func (*StaticAssetsPlugin) Name ¶
func (p *StaticAssetsPlugin) Name() string
Name returns the unique name of the plugin.
func (*StaticAssetsPlugin) Priority ¶
func (p *StaticAssetsPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin priority for the write stage. Static assets should be written early so that other plugins can reference them.
func (*StaticAssetsPlugin) Write ¶
func (p *StaticAssetsPlugin) Write(m *lifecycle.Manager) error
Write copies static assets to the output directory. Files are copied in layers with increasing priority: 1. Embedded theme static files (lowest priority, base layer) 2. Filesystem theme static files (can override embedded) 3. Project static files (highest priority, can override all)
type StaticFileConflict ¶ added in v0.6.0
type StaticFileConflict struct {
// GeneratedSource is the source of the generated file (e.g., "pages/robots.md")
GeneratedSource string
// GeneratedOutput is the output path of the generated file (e.g., "/robots.txt")
GeneratedOutput string
// StaticFile is the path to the conflicting static file (e.g., "static/robots.txt")
StaticFile string
// OutputPath is the final output path that both would write to
OutputPath string
}
StaticFileConflict represents a conflict between a generated file and a static file.
type StaticFileConflictWarning ¶ added in v0.6.0
type StaticFileConflictWarning struct {
Message string
Conflicts []StaticFileConflict
}
StaticFileConflictWarning is a warning (not error) about static file conflicts.
func (*StaticFileConflictWarning) Error ¶ added in v0.6.0
func (w *StaticFileConflictWarning) Error() string
Error implements the error interface.
func (*StaticFileConflictWarning) IsWarning ¶ added in v0.6.0
func (w *StaticFileConflictWarning) IsWarning() bool
IsWarning indicates this is a non-critical warning.
type StaticFileConflictsPlugin ¶ added in v0.6.0
type StaticFileConflictsPlugin struct {
// contains filtered or unexported fields
}
StaticFileConflictsPlugin detects when static files would clobber generated content. This is a lint rule that warns users when they have both: - A generated file (e.g., robots.md → robots.txt) - A static file (e.g., static/robots.txt)
The static file always wins (copied last), which can cause unexpected behavior like private posts not being added to robots.txt.
func NewStaticFileConflictsPlugin ¶ added in v0.6.0
func NewStaticFileConflictsPlugin() *StaticFileConflictsPlugin
NewStaticFileConflictsPlugin creates a new StaticFileConflictsPlugin.
func (*StaticFileConflictsPlugin) Collect ¶ added in v0.6.0
func (p *StaticFileConflictsPlugin) Collect(m *lifecycle.Manager) error
Collect checks for conflicts between generated and static files.
func (*StaticFileConflictsPlugin) Conflicts ¶ added in v0.6.0
func (p *StaticFileConflictsPlugin) Conflicts() []StaticFileConflict
Conflicts returns the detected conflicts.
func (*StaticFileConflictsPlugin) Name ¶ added in v0.6.0
func (p *StaticFileConflictsPlugin) Name() string
Name returns the unique name of the plugin.
func (*StaticFileConflictsPlugin) Priority ¶ added in v0.6.0
func (p *StaticFileConflictsPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin execution priority for the given stage. Run during collect stage after posts are processed but before writing.
func (*StaticFileConflictsPlugin) SetEnabled ¶ added in v0.6.0
func (p *StaticFileConflictsPlugin) SetEnabled(enabled bool)
SetEnabled enables or disables the plugin.
func (*StaticFileConflictsPlugin) SetStaticDir ¶ added in v0.6.0
func (p *StaticFileConflictsPlugin) SetStaticDir(dir string)
SetStaticDir sets the static directory path.
type StatsHelper ¶ added in v0.5.0
type StatsHelper struct {
// contains filtered or unexported fields
}
StatsHelper provides template-friendly access to site statistics. It exposes methods and properties that can be used in Jinja2-style templates for building analytics dashboards and "year in review" style posts.
Template usage examples:
- {{ stats.total_posts }} - Total number of posts
- {{ stats.total_words }} - Total word count
- {{ stats.posts_by_year }} - Map of year to post count
- {{ stats.kpi("total_posts") }} - Get a specific KPI value
- {{ stats.for_feed("blog").total_posts }} - Feed-specific stats
func GetStatsHelper ¶ added in v0.5.0
func GetStatsHelper(m *lifecycle.Manager) *StatsHelper
GetStatsHelper retrieves the stats helper from the cache.
func NewStatsHelper ¶ added in v0.5.0
func NewStatsHelper(m *lifecycle.Manager) *StatsHelper
NewStatsHelper creates a new stats helper for template access.
func (*StatsHelper) AverageReadingTime ¶ added in v0.5.0
func (h *StatsHelper) AverageReadingTime() int
AverageReadingTime returns the average reading time per post.
func (*StatsHelper) AverageWords ¶ added in v0.5.0
func (h *StatsHelper) AverageWords() int
AverageWords returns the average word count per post.
func (*StatsHelper) ForFeed ¶ added in v0.5.0
func (h *StatsHelper) ForFeed(feedName string) *FeedStatsHelper
ForFeed returns a FeedStatsHelper for feed-specific statistics.
func (*StatsHelper) Kpi ¶ added in v0.5.0
func (h *StatsHelper) Kpi(name string) interface{}
Kpi returns a specific KPI value by name. Supported KPIs: total_posts, total_words, total_reading_time, average_words, average_reading_time, total_code_lines, total_code_blocks
func (*StatsHelper) PostsByTag ¶ added in v0.5.0
func (h *StatsHelper) PostsByTag() map[string]int
PostsByTag returns a map of tag name to post count.
func (*StatsHelper) PostsByYear ¶ added in v0.5.0
func (h *StatsHelper) PostsByYear() map[int]int
PostsByYear returns a map of year to post count.
func (*StatsHelper) TotalCodeBlocks ¶ added in v0.5.0
func (h *StatsHelper) TotalCodeBlocks() int
TotalCodeBlocks returns the total number of code blocks.
func (*StatsHelper) TotalCodeLines ¶ added in v0.5.0
func (h *StatsHelper) TotalCodeLines() int
TotalCodeLines returns the total lines of code.
func (*StatsHelper) TotalPosts ¶ added in v0.5.0
func (h *StatsHelper) TotalPosts() int
TotalPosts returns the total number of posts.
func (*StatsHelper) TotalReadingTime ¶ added in v0.5.0
func (h *StatsHelper) TotalReadingTime() int
TotalReadingTime returns the total reading time in minutes.
func (*StatsHelper) TotalReadingTimeText ¶ added in v0.5.0
func (h *StatsHelper) TotalReadingTimeText() string
TotalReadingTimeText returns the formatted total reading time.
func (*StatsHelper) TotalWords ¶ added in v0.5.0
func (h *StatsHelper) TotalWords() int
TotalWords returns the total word count.
func (*StatsHelper) WordsByYear ¶ added in v0.5.0
func (h *StatsHelper) WordsByYear() map[int]int
WordsByYear returns a map of year to total word count.
type StatsPlugin ¶ added in v0.5.0
type StatsPlugin struct {
// contains filtered or unexported fields
}
StatsPlugin calculates comprehensive content statistics for posts and feeds. It provides word count, reading time, character count, and code block metrics for individual posts, and aggregates these statistics at the feed level.
func NewStatsPlugin ¶ added in v0.5.0
func NewStatsPlugin() *StatsPlugin
NewStatsPlugin creates a new StatsPlugin with default settings.
func (*StatsPlugin) Collect ¶ added in v0.5.0
func (p *StatsPlugin) Collect(m *lifecycle.Manager) error
Collect aggregates statistics at the feed level.
func (*StatsPlugin) Configure ¶ added in v0.5.0
func (p *StatsPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*StatsPlugin) Name ¶ added in v0.5.0
func (p *StatsPlugin) Name() string
Name returns the unique name of the plugin.
type StructuredDataPlugin ¶ added in v0.3.0
type StructuredDataPlugin struct{}
StructuredDataPlugin generates JSON-LD Schema.org markup, OpenGraph meta tags, and Twitter Cards for SEO and social media optimization.
func NewStructuredDataPlugin ¶ added in v0.3.0
func NewStructuredDataPlugin() *StructuredDataPlugin
NewStructuredDataPlugin creates a new StructuredDataPlugin.
func (*StructuredDataPlugin) Name ¶ added in v0.3.0
func (p *StructuredDataPlugin) Name() string
Name returns the unique name of the plugin.
type TemplatesPlugin ¶
type TemplatesPlugin struct {
// contains filtered or unexported fields
}
TemplatesPlugin wraps rendered markdown content in HTML templates. It operates during the render stage, after markdown has been converted to HTML.
func NewTemplatesPlugin ¶
func NewTemplatesPlugin() *TemplatesPlugin
NewTemplatesPlugin creates a new templates plugin.
func (*TemplatesPlugin) Configure ¶
func (p *TemplatesPlugin) Configure(m *lifecycle.Manager) error
Configure initializes the template engine from the config.
func (*TemplatesPlugin) Engine ¶
func (p *TemplatesPlugin) Engine() *templates.Engine
Engine returns the template engine for use by other plugins.
func (*TemplatesPlugin) Name ¶
func (p *TemplatesPlugin) Name() string
Name returns the plugin name.
func (*TemplatesPlugin) Priority ¶
func (p *TemplatesPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin priority for the given stage. Templates should run late in the render stage, after markdown rendering.
func (*TemplatesPlugin) Render ¶
func (p *TemplatesPlugin) Render(m *lifecycle.Manager) error
Render wraps markdown content in templates. This runs after markdown rendering, using post.ArticleHTML as the body. Skips posts that don't need rebuilding (incremental builds).
Uses two-phase processing for incremental optimization: Phase 1: Quick single-threaded pass to restore cached HTML (no worker overhead) Phase 2: Concurrent processing only for posts that need rendering
type TocEntry ¶
type TocEntry struct {
// Level is the heading level (1-6)
Level int `json:"level"`
// Text is the heading text
Text string `json:"text"`
// ID is the anchor ID for the heading
ID string `json:"id"`
// Children contains nested headings
Children []*TocEntry `json:"children,omitempty"`
}
TocEntry represents a single entry in the table of contents.
type TocPlugin ¶
type TocPlugin struct {
// contains filtered or unexported fields
}
TocPlugin extracts headings from markdown content and builds a hierarchical table of contents during the transform stage.
func NewTocPlugin ¶
func NewTocPlugin() *TocPlugin
NewTocPlugin creates a new TocPlugin with default settings.
func (*TocPlugin) SetLevelRange ¶
SetLevelRange sets the minimum and maximum heading levels to include.
type URLSet ¶
type URLSet struct {
XMLName xml.Name `xml:"urlset"`
XMLNS string `xml:"xmlns,attr"`
URLs []SitemapURL `xml:"url"`
}
URLSet represents the root element of a sitemap.
type WebMention ¶ added in v0.5.0
type WebMention struct {
// Source is the URL of the page containing the link (your page)
Source string `json:"source"`
// Target is the URL being linked to (external page)
Target string `json:"target"`
// Endpoint is the discovered webmention endpoint
Endpoint string `json:"endpoint,omitempty"`
// Sent indicates whether the webmention was successfully sent
Sent bool `json:"sent"`
// SentAt is when the webmention was sent
SentAt *time.Time `json:"sent_at,omitempty"`
// Error contains any error message from sending
Error string `json:"error,omitempty"`
// StatusCode is the HTTP status code from the endpoint
StatusCode int `json:"status_code,omitempty"`
}
WebMention represents a webmention to be sent.
type WebMentionsPlugin ¶ added in v0.5.0
type WebMentionsPlugin struct {
// contains filtered or unexported fields
}
WebMentionsPlugin sends outgoing webmentions for external links in posts. It runs in the Collect stage after posts have been rendered and links collected.
func NewWebMentionsPlugin ¶ added in v0.5.0
func NewWebMentionsPlugin() *WebMentionsPlugin
NewWebMentionsPlugin creates a new WebMentionsPlugin.
func (*WebMentionsPlugin) Collect ¶ added in v0.5.0
func (p *WebMentionsPlugin) Collect(m *lifecycle.Manager) error
Collect discovers and sends webmentions for external links.
func (*WebMentionsPlugin) Configure ¶ added in v0.5.0
func (p *WebMentionsPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*WebMentionsPlugin) Mentions ¶ added in v0.5.0
func (p *WebMentionsPlugin) Mentions() []*WebMention
Mentions returns the discovered webmentions.
func (*WebMentionsPlugin) Name ¶ added in v0.5.0
func (p *WebMentionsPlugin) Name() string
Name returns the unique name of the plugin.
type WebmentionIOResponse ¶ added in v0.6.0
type WebmentionIOResponse struct {
Type string `json:"type"`
Name string `json:"name"`
Children []ReceivedWebMention `json:"children"`
}
WebmentionIOResponse represents the response from webmention.io API.
type WebmentionLeaderboard ¶ added in v0.6.0
type WebmentionLeaderboard struct {
TopLiked []LeaderboardEntry `json:"top_liked"`
TopReposted []LeaderboardEntry `json:"top_reposted"`
TopReplied []LeaderboardEntry `json:"top_replied"`
TopTotal []LeaderboardEntry `json:"top_total"`
TotalLikes int `json:"total_likes"`
TotalReposts int `json:"total_reposts"`
TotalReplies int `json:"total_replies"`
TotalMentions int `json:"total_mentions"`
}
WebmentionLeaderboard holds the sorted leaderboard lists.
type WebmentionsFetchPlugin ¶ added in v0.6.0
type WebmentionsFetchPlugin struct {
// contains filtered or unexported fields
}
WebmentionsFetchPlugin fetches incoming webmentions from webmention.io.
func NewWebmentionsFetchPlugin ¶ added in v0.6.0
func NewWebmentionsFetchPlugin() *WebmentionsFetchPlugin
NewWebmentionsFetchPlugin creates a new WebmentionsFetchPlugin.
func (*WebmentionsFetchPlugin) Configure ¶ added in v0.6.0
func (p *WebmentionsFetchPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*WebmentionsFetchPlugin) FetchMentions ¶ added in v0.6.0
func (p *WebmentionsFetchPlugin) FetchMentions() error
FetchMentions fetches all webmentions from webmention.io for the configured domain.
func (*WebmentionsFetchPlugin) GetMentions ¶ added in v0.6.0
func (p *WebmentionsFetchPlugin) GetMentions() []ReceivedWebMention
GetMentions returns all fetched mentions.
func (*WebmentionsFetchPlugin) GetMentionsForURL ¶ added in v0.6.0
func (p *WebmentionsFetchPlugin) GetMentionsForURL(targetURL string) []ReceivedWebMention
GetMentionsForURL returns mentions for a specific URL.
func (*WebmentionsFetchPlugin) GroupMentionsByURL ¶ added in v0.6.0
func (p *WebmentionsFetchPlugin) GroupMentionsByURL() map[string][]ReceivedWebMention
GroupMentionsByURL groups mentions by their target URL.
func (*WebmentionsFetchPlugin) Name ¶ added in v0.6.0
func (p *WebmentionsFetchPlugin) Name() string
Name returns the unique name of the plugin.
func (*WebmentionsFetchPlugin) Priority ¶ added in v0.6.0
func (p *WebmentionsFetchPlugin) Priority(stage lifecycle.Stage) int
Priority returns the execution priority for this plugin. For Transform stage, run before other plugins that might cache post maps (like jinja_md which runs at PriorityEarly).
type WebmentionsLeaderboardPlugin ¶ added in v0.6.0
type WebmentionsLeaderboardPlugin struct {
// contains filtered or unexported fields
}
WebmentionsLeaderboardPlugin calculates top posts by webmention engagement.
func NewWebmentionsLeaderboardPlugin ¶ added in v0.6.0
func NewWebmentionsLeaderboardPlugin() *WebmentionsLeaderboardPlugin
NewWebmentionsLeaderboardPlugin creates a new WebmentionsLeaderboardPlugin.
func (*WebmentionsLeaderboardPlugin) Name ¶ added in v0.6.0
func (p *WebmentionsLeaderboardPlugin) Name() string
Name returns the unique name of the plugin.
type WikilinkHoverPlugin ¶ added in v0.2.0
type WikilinkHoverPlugin struct {
// contains filtered or unexported fields
}
WikilinkHoverPlugin adds hover preview data attributes to wikilinks. It runs at the render stage (after wikilinks have been converted to HTML). This plugin finds <a class="wikilink"> tags and adds: - data-preview: truncated description/content for hover tooltips - data-preview-image: featured image URL if available - data-preview-screenshot: screenshot URL if service is configured
func NewWikilinkHoverPlugin ¶ added in v0.2.0
func NewWikilinkHoverPlugin() *WikilinkHoverPlugin
NewWikilinkHoverPlugin creates a new WikilinkHoverPlugin with default settings.
func (*WikilinkHoverPlugin) Config ¶ added in v0.2.0
func (p *WikilinkHoverPlugin) Config() models.WikilinkHoverConfig
Config returns the current plugin configuration.
func (*WikilinkHoverPlugin) Configure ¶ added in v0.2.0
func (p *WikilinkHoverPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "wikilink_hover" key.
func (*WikilinkHoverPlugin) Name ¶ added in v0.2.0
func (p *WikilinkHoverPlugin) Name() string
Name returns the unique name of the plugin.
func (*WikilinkHoverPlugin) Priority ¶ added in v0.2.0
func (p *WikilinkHoverPlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs late in render stage (after wikilinks have been converted).
func (*WikilinkHoverPlugin) Render ¶ added in v0.2.0
func (p *WikilinkHoverPlugin) Render(m *lifecycle.Manager) error
Render processes wikilinks in all post HTML to add hover data attributes.
func (*WikilinkHoverPlugin) SetConfig ¶ added in v0.2.0
func (p *WikilinkHoverPlugin) SetConfig(config models.WikilinkHoverConfig)
SetConfig sets the plugin configuration directly. This is useful for testing or programmatic configuration.
type WikilinksPlugin ¶
type WikilinksPlugin struct {
// contains filtered or unexported fields
}
WikilinksPlugin transforms [[slug]] and [[slug|text]] wikilink syntax into HTML anchor tags during the transform stage.
func NewWikilinksPlugin ¶
func NewWikilinksPlugin() *WikilinksPlugin
NewWikilinksPlugin creates a new WikilinksPlugin.
func (*WikilinksPlugin) Configure ¶
func (p *WikilinksPlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin.
func (*WikilinksPlugin) Name ¶
func (p *WikilinksPlugin) Name() string
Name returns the unique name of the plugin.
func (*WikilinksPlugin) SetWarnOnBroken ¶
func (p *WikilinksPlugin) SetWarnOnBroken(warn bool)
SetWarnOnBroken enables or disables warnings for broken links.
type YouTubePlugin ¶ added in v0.3.0
type YouTubePlugin struct {
// contains filtered or unexported fields
}
YouTubePlugin converts YouTube URLs into embedded iframes. It runs at the render stage (after markdown conversion) and handles both plain URLs and autolinked URLs (from the Linkify extension).
func NewYouTubePlugin ¶ added in v0.3.0
func NewYouTubePlugin() *YouTubePlugin
NewYouTubePlugin creates a new YouTubePlugin with default settings.
func (*YouTubePlugin) Config ¶ added in v0.3.0
func (p *YouTubePlugin) Config() models.YouTubeConfig
Config returns the current plugin configuration.
func (*YouTubePlugin) Configure ¶ added in v0.3.0
func (p *YouTubePlugin) Configure(m *lifecycle.Manager) error
Configure reads configuration options for the plugin from config.Extra. Configuration is expected under the "youtube" key.
func (*YouTubePlugin) Name ¶ added in v0.3.0
func (p *YouTubePlugin) Name() string
Name returns the unique name of the plugin.
func (*YouTubePlugin) Priority ¶ added in v0.3.0
func (p *YouTubePlugin) Priority(stage lifecycle.Stage) int
Priority returns the plugin's priority for a given stage. This plugin runs after render_markdown (which has default priority 0).
func (*YouTubePlugin) Render ¶ added in v0.3.0
func (p *YouTubePlugin) Render(m *lifecycle.Manager) error
Render processes YouTube URLs in the rendered HTML.
func (*YouTubePlugin) SetConfig ¶ added in v0.3.0
func (p *YouTubePlugin) SetConfig(config models.YouTubeConfig)
SetConfig sets the plugin configuration directly.
Source Files
¶
- admonitions.go
- atom.go
- auto_feeds.go
- auto_title.go
- background.go
- blogroll.go
- breadcrumbs.go
- build_cache.go
- chartjs.go
- chroma_css.go
- constants.go
- containers.go
- contribution_graph.go
- csv_fence.go
- description.go
- embeds.go
- feed_parser.go
- feeds.go
- frontmatter.go
- glob.go
- glossary.go
- heading_anchors.go
- image_zoom.go
- inline_attributes.go
- jinja_md.go
- jsonfeed.go
- keys.go
- link_collector.go
- load.go
- mark.go
- md_video.go
- mentions.go
- mermaid.go
- one_line_link.go
- overwrite_check.go
- pagefind.go
- pagefind_installer.go
- palette_css.go
- prevnext.go
- publish_feeds.go
- publish_html.go
- qrcode.go
- reading_time.go
- redirects.go
- registry.go
- render_markdown.go
- rss.go
- sitemap.go
- slug_conflicts.go
- static_assets.go
- static_file_conflicts.go
- stats.go
- structured_data.go
- templates.go
- toc.go
- webmentions.go
- webmentions_bridging.go
- webmentions_fetch.go
- webmentions_leaderboard.go
- wikilink_hover.go
- wikilinks.go
- youtube.go