plugins

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 79 Imported by: 0

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 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.

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

View Source
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.

View Source
const EncryptionEnvPrefix = "MARKATA_GO_ENCRYPTION_KEY_"

EncryptionEnvPrefix is the prefix for encryption key environment variables.

View Source
const JSONFeedVersion = "https://jsonfeed.org/version/1.1"

JSONFeedVersion is the JSON Feed specification version.

Variables

View Source
var ErrInvalidFrontmatter = errors.New("invalid frontmatter")

ErrInvalidFrontmatter indicates the frontmatter could not be parsed.

View Source
var KindAdmonition = ast.NewNodeKind("Admonition")

KindAdmonition is the AST node kind for admonitions.

View Source
var KindContainer = ast.NewNodeKind("Container")

KindContainer is the AST node kind for container elements.

View Source
var KindKeys = ast.NewNodeKind("Keys")

KindKeys is the AST node kind for keyboard key elements.

View Source
var KindMark = ast.NewNodeKind("Mark")

KindMark is the AST node kind for mark (highlight) elements.

Functions

func ByNames

func ByNames(names []string) (pluginList []lifecycle.Plugin, warnings []string)

ByNames creates plugin instances from a list of names. Unknown plugin names are skipped with a warning returned.

func DefaultPlugins

func DefaultPlugins() []lifecycle.Plugin

DefaultPlugins returns all standard plugins in their recommended execution order. This is the typical set of plugins for a complete markata build.

func DiscoveryFeedToMap added in v0.7.0

func DiscoveryFeedToMap(df *DiscoveryFeed) map[string]interface{}

DiscoveryFeedToMap converts a DiscoveryFeed to a map for template context.

func ExtractFrontmatter

func ExtractFrontmatter(content string) (frontmatter, body string, err error)

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 FindPostSidebarFeed added in v0.7.0

func FindPostSidebarFeed(post *models.Post, config *lifecycle.Config, feedConfigs []models.FeedConfig) *models.FeedConfig

FindPostSidebarFeed finds the sidebar feed for a post. It checks if the post belongs to any feed configured for sidebar display. Returns the feed config and a boolean indicating if a match was found.

func GenerateAtom

func GenerateAtom(feed *lifecycle.Feed, config *lifecycle.Config) (string, error)

GenerateAtom generates an Atom feed from a lifecycle.Feed.

func GenerateAtomFromFeedConfig

func GenerateAtomFromFeedConfig(fc *models.FeedConfig, config *lifecycle.Config) (string, error)

GenerateAtomFromFeedConfig generates an Atom feed from a FeedConfig.

func GenerateJSONFeed

func GenerateJSONFeed(feed *lifecycle.Feed, config *lifecycle.Config) (string, error)

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

func GenerateRSS(feed *lifecycle.Feed, config *lifecycle.Config) (string, error)

GenerateRSS generates an RSS 2.0 feed from a lifecycle.Feed.

func GenerateRSSFromFeedConfig

func GenerateRSSFromFeedConfig(fc *models.FeedConfig, config *lifecycle.Config) (string, error)

GenerateRSSFromFeedConfig generates an RSS 2.0 feed from a FeedConfig.

func GetBool

func GetBool(metadata map[string]interface{}, key string, defaultVal bool) bool

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 GetFeedBySlug added in v0.7.0

func GetFeedBySlug(slug string, feedConfigs []models.FeedConfig) *models.FeedConfig

GetFeedBySlug finds a feed config by slug from the feed configs list.

func GetPlatformAssetName added in v0.3.0

func GetPlatformAssetName() (string, error)

GetPlatformAssetName returns the Pagefind asset name for the current platform.

func GetString

func GetString(metadata map[string]interface{}, key string) string

GetString extracts a string value from metadata, returning empty string if not found or wrong type.

func GetStringSlice

func GetStringSlice(metadata map[string]interface{}, key string) []string

GetStringSlice extracts a string slice from metadata. Handles both []interface{} (common from YAML) and []string.

func MinimalPlugins

func MinimalPlugins() []lifecycle.Plugin

MinimalPlugins returns a minimal set of plugins for basic builds. This includes only essential plugins for rendering posts without feeds.

func ParseFrontmatter

func ParseFrontmatter(content string) (metadata map[string]interface{}, body string, err error)

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 ParsePostFromContent added in v0.7.0

func ParsePostFromContent(path, content string) (*models.Post, error)

ParsePostFromContent parses a markdown file content into a Post. This is a lightweight helper for cache-backed workflows that need frontmatter parsing and slug generation without running the full lifecycle.

func PlatformColors added in v0.5.0

func PlatformColors() map[string]string

PlatformColors returns CSS color values for each platform.

func PlatformEmoji added in v0.5.0

func PlatformEmoji() map[string]string

PlatformEmoji returns an emoji for each platform.

func PlatformName added in v0.5.0

func PlatformName() map[string]string

PlatformName returns a display name for each platform.

func PluginByName

func PluginByName(name string) (lifecycle.Plugin, bool)

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

func RegisterPluginConstructor(name string, constructor func() lifecycle.Plugin)

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

func ToModelsConfig(config *lifecycle.Config) *models.Config

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). Note: This is not cached because lifecycle.Config.Extra is mutable and may be modified by plugins throughout the build process (e.g., image_zoom sets glightbox_enabled).

func TransformPlugins

func TransformPlugins() []lifecycle.Plugin

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) Close

func (p *AdmonitionParser) Close(_ ast.Node, _ text.Reader, _ parser.Context)

Close is called when the admonition block is closed.

func (*AdmonitionParser) Continue

func (p *AdmonitionParser) Continue(_ ast.Node, reader text.Reader, _ parser.Context) parser.State

Continue checks if the admonition block continues. Admonition content is indented with at least 4 spaces. Blank lines are allowed within admonitions; the block closes when a non-blank line with fewer than 4 spaces of indentation is encountered.

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

type AdmonitionRenderer struct {
	html.Config
}

AdmonitionRenderer renders Admonition nodes to HTML.

func NewAdmonitionRenderer

func NewAdmonitionRenderer() *AdmonitionRenderer

NewAdmonitionRenderer creates a new AdmonitionRenderer.

func (*AdmonitionRenderer) RegisterFuncs

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

type AtomContent struct {
	Type  string `xml:"type,attr"`
	Value string `xml:",chardata"`
}

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 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 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 AuthorsPlugin added in v0.7.0

type AuthorsPlugin struct{}

AuthorsPlugin resolves author IDs in posts against the site-wide authors configuration. For each post that has Authors or Author frontmatter fields, this plugin populates the computed AuthorObjects field with fully resolved Author structs. It also assigns the default author to posts with no authors.

func NewAuthorsPlugin added in v0.7.0

func NewAuthorsPlugin() *AuthorsPlugin

NewAuthorsPlugin creates a new AuthorsPlugin.

func (*AuthorsPlugin) Name added in v0.7.0

func (p *AuthorsPlugin) Name() string

Name returns the unique name of the plugin.

func (*AuthorsPlugin) Priority added in v0.7.0

func (p *AuthorsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. Authors should run very early in transform, right after auto_title, so that resolved author data is available for other plugins (e.g., structured_data).

func (*AuthorsPlugin) Transform added in v0.7.0

func (p *AuthorsPlugin) Transform(m *lifecycle.Manager) error

Transform resolves author IDs for all posts. For each post with author references, it looks up the Author structs from config.Authors.Authors and populates post.AuthorObjects. Posts without any author references get the default author assigned. Per-post role overrides from AuthorRoleOverrides take precedence over config roles.

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.

func (*AutoFeedsPlugin) Priority added in v0.6.0

func (p *AutoFeedsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage.

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:

  1. Frontmatter title (explicit, highest priority)
  2. First H1 heading from markdown content
  3. Filename-based title (with date prefix stripping)
  4. Directory name (for index.md files)
  5. 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.

func (*AutoTitlePlugin) Priority

func (p *AutoTitlePlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. Auto title should run very early in transform to have title available for other plugins.

func (*AutoTitlePlugin) Transform

func (p *AutoTitlePlugin) Transform(m *lifecycle.Manager) error

Transform generates titles for posts that don't have one. Uses a comprehensive fallback strategy to ensure no post has a nil title.

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

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.

func (*BlogrollPlugin) Priority added in v0.5.0

func (p *BlogrollPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage.

func (*BlogrollPlugin) Write added in v0.5.0

func (p *BlogrollPlugin) Write(m *lifecycle.Manager) error

Write generates the blogroll and reader pages.

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 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 struct {
	Label string `json:"label" yaml:"label"`
	URL   string `json:"url" yaml:"url"`
}

BreadcrumbItem is a manual breadcrumb entry from frontmatter.

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 struct {
	Context         string               `json:"@context"`
	Type            string               `json:"@type"`
	ItemListElement []BreadcrumbListItem `json:"itemListElement"`
}

BreadcrumbListJSON is the JSON-LD structured data for breadcrumbs.

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 (p *BreadcrumbsPlugin) Configure(m *lifecycle.Manager) error

Configure reads configuration options for the plugin.

func (p *BreadcrumbsPlugin) Name() string

Name returns the unique name of the plugin.

func (p *BreadcrumbsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. Breadcrumbs should run after auto_title so titles are available.

func (p *BreadcrumbsPlugin) Transform(m *lifecycle.Manager) error

Transform generates breadcrumbs for each post.

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.

func (*BuildCachePlugin) Priority added in v0.6.0

func (p *BuildCachePlugin) Priority(stage lifecycle.Stage) int

Priority returns high priority so it runs early in configure and late in cleanup. For transform, it runs late to collect dependencies after other plugins have processed links.

func (*BuildCachePlugin) Transform added in v0.6.0

func (p *BuildCachePlugin) Transform(m *lifecycle.Manager) error

Transform collects dependencies from posts after wikilinks/embeds have processed them. This runs late in the transform stage to ensure all dependencies have been collected.

type CDNAssetsPlugin added in v0.7.0

type CDNAssetsPlugin struct{}

CDNAssetsPlugin handles downloading and self-hosting external CDN assets. When configured for self-hosting, it: 1. Downloads CDN assets during Configure stage 2. Copies them to output during Write stage 3. Provides URL mappings for templates to use local paths

func NewCDNAssetsPlugin added in v0.7.0

func NewCDNAssetsPlugin() *CDNAssetsPlugin

NewCDNAssetsPlugin creates a new CDNAssetsPlugin.

func (*CDNAssetsPlugin) Configure added in v0.7.0

func (p *CDNAssetsPlugin) Configure(m *lifecycle.Manager) error

Configure downloads CDN assets when self-hosting is enabled.

func (*CDNAssetsPlugin) Name added in v0.7.0

func (p *CDNAssetsPlugin) Name() string

Name returns the unique name of the plugin.

func (*CDNAssetsPlugin) Priority added in v0.7.0

func (p *CDNAssetsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for each stage. Configure: Early - download assets before other plugins need them Write: Early - copy assets before HTML is generated so paths resolve

func (*CDNAssetsPlugin) Write added in v0.7.0

func (p *CDNAssetsPlugin) Write(m *lifecycle.Manager) error

Write copies cached assets to the output directory.

type CLIConfig added in v0.7.0

type CLIConfig struct {
	MMDCPath  string
	ExtraArgs string
}

CLIConfig is a helper for CLI renderer configuration

type CSSBundlePlugin added in v0.7.0

type CSSBundlePlugin struct {
	// contains filtered or unexported fields
}

CSSBundlePlugin combines multiple CSS files into optimized bundles. It runs during the Write stage, after other CSS-generating plugins (palette_css, chroma_css) have completed. This reduces HTTP requests and improves page load performance.

The plugin: - Discovers CSS files in the output directory - Matches files to bundle configurations - Respects CSS load order (files are concatenated in config order) - Writes bundled output with optional source comments - Stores bundle paths in the cache for template access

func NewCSSBundlePlugin added in v0.7.0

func NewCSSBundlePlugin() *CSSBundlePlugin

NewCSSBundlePlugin creates a new CSSBundlePlugin.

func (*CSSBundlePlugin) Configure added in v0.7.0

func (p *CSSBundlePlugin) Configure(m *lifecycle.Manager) error

Configure reads the CSS bundle configuration from the manager's config.

func (*CSSBundlePlugin) Name added in v0.7.0

func (p *CSSBundlePlugin) Name() string

Name returns the unique name of the plugin.

func (*CSSBundlePlugin) Priority added in v0.7.0

func (p *CSSBundlePlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the write stage. Should run after other CSS-generating plugins (palette_css, chroma_css) so all CSS files are available for bundling.

func (*CSSBundlePlugin) Write added in v0.7.0

func (p *CSSBundlePlugin) Write(m *lifecycle.Manager) error

Write performs CSS bundling in the output directory.

type CSSMinifyPlugin added in v0.7.0

type CSSMinifyPlugin struct {
	// contains filtered or unexported fields
}

CSSMinifyPlugin minifies CSS files to reduce file sizes and improve Lighthouse performance scores. It runs during the Write stage, after all other CSS-generating plugins (palette_css, chroma_css, css_bundle) have completed.

The plugin: - Discovers CSS files in the output directory - Minifies each file using tdewolff/minify - Preserves specified comments (e.g., copyright notices) - Skips excluded files - Reports size reduction statistics

func NewCSSMinifyPlugin added in v0.7.0

func NewCSSMinifyPlugin() *CSSMinifyPlugin

NewCSSMinifyPlugin creates a new CSSMinifyPlugin.

func (*CSSMinifyPlugin) Configure added in v0.7.0

func (p *CSSMinifyPlugin) Configure(m *lifecycle.Manager) error

Configure reads the CSS minify configuration from the manager's config.

func (*CSSMinifyPlugin) Name added in v0.7.0

func (p *CSSMinifyPlugin) Name() string

Name returns the unique name of the plugin.

func (*CSSMinifyPlugin) Priority added in v0.7.0

func (p *CSSMinifyPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the write stage. Should run late (after palette_css, chroma_css, css_bundle) to minify all CSS.

func (*CSSMinifyPlugin) Write added in v0.7.0

func (p *CSSMinifyPlugin) Write(m *lifecycle.Manager) error

Write performs CSS minification in the output directory.

type CSSPurgePlugin added in v0.7.0

type CSSPurgePlugin struct{}

CSSPurgePlugin removes unused CSS rules from stylesheets based on which selectors are actually used in the generated HTML files.

This plugin runs in the Cleanup stage after all HTML has been written, allowing it to scan the final output and optimize CSS accordingly.

The plugin supports preserving dynamically-added classes (like those from JavaScript frameworks) via glob patterns in the configuration.

func NewCSSPurgePlugin added in v0.7.0

func NewCSSPurgePlugin() *CSSPurgePlugin

NewCSSPurgePlugin creates a new CSSPurgePlugin.

func (*CSSPurgePlugin) Cleanup added in v0.7.0

func (p *CSSPurgePlugin) Cleanup(m *lifecycle.Manager) error

Cleanup scans HTML files and removes unused CSS rules. This runs after all content has been written to the output directory.

func (*CSSPurgePlugin) Name added in v0.7.0

func (p *CSSPurgePlugin) Name() string

Name returns the unique name of the plugin.

func (*CSSPurgePlugin) Priority added in v0.7.0

func (p *CSSPurgePlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the cleanup stage. CSS purge runs before Pagefind (PriorityDefault) since Pagefind indexes content but doesn't need CSS, and we want smaller CSS files deployed.

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 and pre-generates the CSS. This runs before templates are rendered, allowing us to register the hash for cache busting (css/chroma.css -> css/chroma.abc12345.css).

func (*ChromaCSSPlugin) Name added in v0.3.0

func (p *ChromaCSSPlugin) Name() string

Name returns the unique name of the plugin.

func (*ChromaCSSPlugin) Priority added in v0.3.0

func (p *ChromaCSSPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the write stage. Should run after static_assets so it can add to the css directory.

func (*ChromaCSSPlugin) Write added in v0.3.0

func (p *ChromaCSSPlugin) Write(m *lifecycle.Manager) error

Write generates the Chroma CSS file. The CSS content was already generated in Configure() for cache busting.

type ChromiumConfig added in v0.7.0

type ChromiumConfig struct {
	BrowserPath   string
	Timeout       int
	MaxConcurrent int
}

ChromiumConfig is a helper for Chromium renderer configuration

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

func NewContainer(classes []string, id string, attrs map[string]string) *Container

NewContainer creates a new Container node.

func (*Container) Dump added in v0.6.0

func (n *Container) Dump(source []byte, level int)

Dump dumps the node for debugging.

func (*Container) Kind added in v0.6.0

func (n *Container) Kind() ast.NodeKind

Kind returns the kind of this 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

Config returns the current contribution graph configuration.

func (*ContributionGraphPlugin) Configure added in v0.6.0

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

Render processes contribution-graph code blocks in the rendered HTML for all posts.

func (*ContributionGraphPlugin) SetConfig added in v0.6.0

SetConfig sets the contribution graph configuration directly. This is useful for testing or programmatic configuration.

type CriticalCSSPlugin added in v0.7.0

type CriticalCSSPlugin struct {
	// contains filtered or unexported fields
}

CriticalCSSPlugin extracts critical CSS and inlines it in HTML files. It runs during the Write stage after publish_html to process generated HTML.

Critical CSS optimization improves First Contentful Paint (FCP) by: 1. Extracting CSS needed for above-the-fold content 2. Inlining critical CSS directly in the HTML <head> 3. Async loading non-critical CSS via link rel="preload"

This typically improves FCP by 200-800ms by eliminating render-blocking CSS.

func NewCriticalCSSPlugin added in v0.7.0

func NewCriticalCSSPlugin() *CriticalCSSPlugin

NewCriticalCSSPlugin creates a new CriticalCSSPlugin.

func (*CriticalCSSPlugin) Configure added in v0.7.0

func (p *CriticalCSSPlugin) Configure(m *lifecycle.Manager) error

Configure loads the critical CSS configuration from the lifecycle manager.

func (*CriticalCSSPlugin) Name added in v0.7.0

func (p *CriticalCSSPlugin) Name() string

Name returns the unique name of the plugin.

func (*CriticalCSSPlugin) Priority added in v0.7.0

func (p *CriticalCSSPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage.

func (*CriticalCSSPlugin) Write added in v0.7.0

Write processes HTML files to inline critical CSS.

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.

func (*DescriptionPlugin) Transform

func (p *DescriptionPlugin) Transform(m *lifecycle.Manager) error

Transform generates descriptions for posts that don't have one, and strips wikilinks from all descriptions (including user-provided ones).

type DiscoveryFeed added in v0.7.0

type DiscoveryFeed struct {
	// Slug is the feed slug (e.g., "tags/python", "archive", "")
	Slug string

	// Title is the feed title for display
	Title string

	// RSSURL is the RSS feed URL (if RSS format is enabled)
	RSSURL string

	// AtomURL is the Atom feed URL (if Atom format is enabled)
	AtomURL string

	// JSONURL is the JSON feed URL (if JSON format is enabled)
	JSONURL string

	// HasRSS indicates whether RSS format is enabled
	HasRSS bool

	// HasAtom indicates whether Atom format is enabled
	HasAtom bool

	// HasJSON indicates whether JSON format is enabled
	HasJSON bool
}

DiscoveryFeed represents feed discovery information for templates. This is injected into template context to enable per-page feed discovery.

func GetDiscoveryFeed added in v0.7.0

func GetDiscoveryFeed(_ *models.Post, sidebarFeed *models.FeedConfig, allFeeds []models.FeedConfig) *DiscoveryFeed

GetDiscoveryFeed returns the discovery feed for a post. If the post has a sidebar_feed, that feed is used for discovery. Otherwise, the site default feed (root subscription feed) is used.

The post parameter is reserved for future use when discovery logic may need to inspect post metadata (e.g., explicit feed assignment). This function is called from templates.go renderPost to inject discovery_feed context.

type EmbedOptions added in v0.7.0

type EmbedOptions struct {
	NoTitle       bool
	NoDescription bool
	NoMeta        bool
	ImageOnly     bool
	Center        bool
	FullWidth     bool
	Video         bool
	Link          bool
	Rich          bool
	Hover         bool
	Card          bool
	Performance   bool
	TitleOverride string
	Classes       []string
}

EmbedOptions holds parsing options for embed syntax. Supports: no_title, no_description, no_meta, image_only, center, full_width, video, link, rich, hover, card, performance

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.

func (*EmbedsPlugin) Transform added in v0.5.0

func (p *EmbedsPlugin) Transform(m *lifecycle.Manager) error

Transform processes embed syntax in all post content.

type EncryptionBuildError added in v0.7.0

type EncryptionBuildError struct {
	Posts []string
	Msg   string
}

EncryptionBuildError is returned when a private post cannot be encrypted. It implements lifecycle.CriticalError to halt the build and prevent exposing unencrypted private content.

func (*EncryptionBuildError) Error added in v0.7.0

func (e *EncryptionBuildError) Error() string

func (*EncryptionBuildError) IsCritical added in v0.7.0

func (e *EncryptionBuildError) IsCritical() bool

IsCritical marks this error as a build-halting error. Private posts must never be published without encryption.

type EncryptionPlugin added in v0.7.0

type EncryptionPlugin struct {
	// contains filtered or unexported fields
}

EncryptionPlugin encrypts content for private posts. It runs during the Render stage (after markdown is converted to HTML) to encrypt the ArticleHTML content.

Encryption is enabled by default

The plugin is enabled by default with default_key="default". Users only need to set MARKATA_GO_ENCRYPTION_KEY_DEFAULT in their environment or .env file.

How It Works

  1. Posts with private: true are automatically encrypted
  2. Posts with tags matching [encryption.private_tags] are treated as private
  3. Frontmatter secret_key (or aliases: private_key, encryption_key) specifies which key to use
  4. If no key is specified, the default_key is used
  5. The build FAILS if a private post has no available encryption key

Client-Side Decryption

The encrypted content is wrapped in a div with data attributes. The client-side JavaScript uses Web Crypto API with matching PBKDF2 parameters.

func NewEncryptionPlugin added in v0.7.0

func NewEncryptionPlugin() *EncryptionPlugin

NewEncryptionPlugin creates a new EncryptionPlugin.

func (*EncryptionPlugin) Configure added in v0.7.0

func (p *EncryptionPlugin) Configure(m *lifecycle.Manager) error

Configure loads encryption configuration and encryption keys from environment.

func (*EncryptionPlugin) Name added in v0.7.0

func (p *EncryptionPlugin) Name() string

Name returns the unique name of the plugin.

func (*EncryptionPlugin) Priority added in v0.7.0

func (p *EncryptionPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. Encryption should run in the middle of the Render stage: - After markdown is rendered to HTML (PriorityDefault/PriorityEarly) - Before templates wrap the HTML (PriorityLate)

func (*EncryptionPlugin) Render added in v0.7.0

func (p *EncryptionPlugin) Render(m *lifecycle.Manager) error

Render encrypts content for private posts with encryption keys. Returns a CriticalError if any private post cannot be encrypted, preventing unencrypted private content from being published.

type ErrorPagesPlugin added in v0.7.0

type ErrorPagesPlugin struct{}

ErrorPagesPlugin generates static error pages (404.html) during build. The 404 page includes: - A prefilled search form based on the URL path - Client-side slug matching to suggest similar pages - Optional Pagefind integration for enhanced search

func NewErrorPagesPlugin added in v0.7.0

func NewErrorPagesPlugin() *ErrorPagesPlugin

NewErrorPagesPlugin creates a new ErrorPagesPlugin.

func (*ErrorPagesPlugin) Name added in v0.7.0

func (p *ErrorPagesPlugin) Name() string

Name returns the plugin name.

func (*ErrorPagesPlugin) Write added in v0.7.0

func (p *ErrorPagesPlugin) Write(m *lifecycle.Manager) error

Write generates static error pages during the Write stage.

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.

func GetFeedStats added in v0.5.0

func GetFeedStats(m *lifecycle.Manager, feedSlug string) *FeedStats

GetFeedStats retrieves feed statistics from the cache.

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 NewFeedsPlugin

func NewFeedsPlugin() *FeedsPlugin

NewFeedsPlugin creates a new FeedsPlugin.

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 GardenEdge added in v0.7.0

type GardenEdge struct {
	// Source is the ID of the source node
	Source string `json:"source"`

	// Target is the ID of the target node
	Target string `json:"target"`

	// Type is the edge type: "link", "tag", or "co-occurrence"
	Type string `json:"type"`

	// Weight is the strength of the relationship (for co-occurrence edges)
	Weight int `json:"weight,omitempty"`
}

GardenEdge represents a relationship between two nodes in the garden graph.

type GardenGraph added in v0.7.0

type GardenGraph struct {
	// Nodes is the list of all nodes in the graph
	Nodes []GardenNode `json:"nodes"`

	// Edges is the list of all edges in the graph
	Edges []GardenEdge `json:"edges"`
}

GardenGraph is the complete graph data structure exported as JSON.

type GardenNode added in v0.7.0

type GardenNode struct {
	// ID is the unique identifier for this node (e.g., "post:my-slug" or "tag:go")
	ID string `json:"id"`

	// Type is the node type: "post" or "tag"
	Type string `json:"type"`

	// Label is the display name for this node
	Label string `json:"label"`

	// Href is the URL to the node's page
	Href string `json:"href"`

	// Tags is the list of tags (only for post nodes)
	Tags []string `json:"tags,omitempty"`

	// Date is the publication date (only for post nodes)
	Date string `json:"date,omitempty"`

	// Description is a short description (only for post nodes)
	Description string `json:"description,omitempty"`

	// Count is the number of posts with this tag (only for tag nodes)
	Count int `json:"count,omitempty"`
}

GardenNode represents a node in the garden knowledge graph.

type GardenViewPlugin added in v0.7.0

type GardenViewPlugin struct {
	// contains filtered or unexported fields
}

GardenViewPlugin generates a knowledge graph JSON file and optional garden page. It runs during the Write stage after link_collector and feeds have finished.

func NewGardenViewPlugin added in v0.7.0

func NewGardenViewPlugin() *GardenViewPlugin

NewGardenViewPlugin creates a new GardenViewPlugin.

func (*GardenViewPlugin) Name added in v0.7.0

func (p *GardenViewPlugin) Name() string

Name returns the unique name of the plugin.

func (*GardenViewPlugin) Priority added in v0.7.0

func (p *GardenViewPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage.

func (*GardenViewPlugin) Write added in v0.7.0

func (p *GardenViewPlugin) Write(m *lifecycle.Manager) error

Write generates the garden graph JSON and optional HTML page.

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. Uses cached file list when patterns haven't changed.

func (*GlobPlugin) Name

func (p *GlobPlugin) Name() string

Name returns the plugin identifier.

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.

func (*GlossaryPlugin) Write

func (p *GlossaryPlugin) Write(m *lifecycle.Manager) error

Write exports the glossary JSON file if configured.

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 HashtagTagsPlugin added in v0.7.0

type HashtagTagsPlugin struct {
	// contains filtered or unexported fields
}

HashtagTagsPlugin transforms #tag syntax into HTML links with tag statistics. The hashtag references tags but does not modify the post's actual tags.

func NewHashtagTagsPlugin added in v0.7.0

func NewHashtagTagsPlugin() *HashtagTagsPlugin

NewHashtagTagsPlugin creates a new HashtagTagsPlugin.

func (*HashtagTagsPlugin) Configure added in v0.7.0

func (p *HashtagTagsPlugin) Configure(m *lifecycle.Manager) error

Configure reads configuration options for the plugin.

func (*HashtagTagsPlugin) Name added in v0.7.0

func (p *HashtagTagsPlugin) Name() string

Name returns the unique name of the plugin.

func (*HashtagTagsPlugin) Priority added in v0.7.0

func (p *HashtagTagsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage. Runs late in transform stage, after markdown rendering but before other text transforms.

func (*HashtagTagsPlugin) Transform added in v0.7.0

func (p *HashtagTagsPlugin) Transform(m *lifecycle.Manager) error

Transform processes #tag references in all post content.

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

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 ImageOptimizationConfig added in v0.7.0

type ImageOptimizationConfig struct {
	Enabled     bool
	Formats     []string
	Quality     int
	AvifQuality int
	WebpQuality int
	Widths      []int
	Sizes       string
	CacheDir    string
	AvifencPath string
	CwebpPath   string
}

ImageOptimizationConfig holds configuration for image optimization.

type ImageOptimizationPlugin added in v0.7.0

type ImageOptimizationPlugin struct {
	// contains filtered or unexported fields
}

ImageOptimizationPlugin generates modern image formats for local images. It rewrites HTML to use <picture> with AVIF/WebP sources and caches encodes.

func NewImageOptimizationPlugin added in v0.7.0

func NewImageOptimizationPlugin() *ImageOptimizationPlugin

func (*ImageOptimizationPlugin) Configure added in v0.7.0

func (*ImageOptimizationPlugin) Name added in v0.7.0

func (p *ImageOptimizationPlugin) Name() string

func (*ImageOptimizationPlugin) Priority added in v0.7.0

func (p *ImageOptimizationPlugin) Priority(stage lifecycle.Stage) int

func (*ImageOptimizationPlugin) Render added in v0.7.0

func (*ImageOptimizationPlugin) Write added in v0.7.0

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

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.

func (*ImageZoomPlugin) Write added in v0.6.0

func (p *ImageZoomPlugin) Write(m *lifecycle.Manager) error

Write injects GLightbox CSS and JS into posts that need it.

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:

![alt text](image.webp){.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 JSMinifyPlugin added in v0.7.0

type JSMinifyPlugin struct {
	// contains filtered or unexported fields
}

JSMinifyPlugin minifies JavaScript files to reduce file sizes and improve Lighthouse performance scores. It runs during the Cleanup stage (after all HTML is written) at PriorityLast to ensure all JS files are in their final form before minification.

The plugin:

  • Discovers JS files in the output directory
  • Minifies each file using tdewolff/minify
  • Skips excluded files (e.g., already-minified vendor JS)
  • Reports size reduction statistics

func NewJSMinifyPlugin added in v0.7.0

func NewJSMinifyPlugin() *JSMinifyPlugin

NewJSMinifyPlugin creates a new JSMinifyPlugin.

func (*JSMinifyPlugin) Configure added in v0.7.0

func (p *JSMinifyPlugin) Configure(m *lifecycle.Manager) error

Configure reads the JS minify configuration from the manager's config.

func (*JSMinifyPlugin) Name added in v0.7.0

func (p *JSMinifyPlugin) Name() string

Name returns the unique name of the plugin.

func (*JSMinifyPlugin) Priority added in v0.7.0

func (p *JSMinifyPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the write stage. Should run very late (after all JS-generating plugins) to minify all JS.

func (*JSMinifyPlugin) Write added in v0.7.0

func (p *JSMinifyPlugin) Write(m *lifecycle.Manager) error

Write performs JS minification in the output directory.

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.

func (*JinjaMdPlugin) Name

func (p *JinjaMdPlugin) Name() string

Name returns the plugin name.

func (*JinjaMdPlugin) Priority

func (p *JinjaMdPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. JinjaMd should run early in the transform stage, before other transforms.

func (*JinjaMdPlugin) Transform

func (p *JinjaMdPlugin) Transform(m *lifecycle.Manager) error

Transform processes jinja templates in markdown content. Only posts with `jinja: true` or `jinja_md: true` in their frontmatter are processed.

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++).

func NewKeys added in v0.6.0

func NewKeys(keys []string) *Keys

NewKeys creates a new Keys node.

func (*Keys) Dump added in v0.6.0

func (n *Keys) Dump(source []byte, level int)

Dump dumps the node for debugging.

func (*Keys) Kind added in v0.6.0

func (n *Keys) Kind() ast.NodeKind

Kind returns the kind of this node.

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 LinkAvatarsConfig added in v0.7.0

type LinkAvatarsConfig struct {
	// Enabled controls whether the plugin is active.
	// Default: false
	Enabled bool

	// Mode controls how avatars are applied: "js", "local", or "hosted".
	// Default: "js"
	Mode string

	// Selector is the CSS selector for links to enhance.
	// Default: "a[href^='http']"
	Selector string

	// Service is the avatar service provider: "duckduckgo", "google", "custom"
	// Default: "duckduckgo"
	Service string

	// Template is a custom URL template (only used when Service = "custom").
	// Supports placeholders: {origin}, {host}
	Template string

	// IgnoreDomains is a list of domains to skip.
	IgnoreDomains []string

	// IgnoreOrigins is a list of full origins to skip (includes protocol).
	IgnoreOrigins []string

	// IgnoreSelectors is a list of CSS selectors to exclude.
	IgnoreSelectors []string

	// IgnoreClasses is a list of CSS classes to exclude.
	IgnoreClasses []string

	// IgnoreIDs is a list of element IDs to exclude.
	IgnoreIDs []string

	// Size is the avatar icon size in pixels.
	// Default: 16
	Size int

	// Position is where to place the avatar: "before" or "after" link text.
	// Default: "before"
	Position string

	// HostedBaseURL is the base URL for hosted mode assets.
	// Used when Mode = "hosted".
	HostedBaseURL string
}

LinkAvatarsConfig holds configuration for the link_avatars plugin.

type LinkAvatarsPlugin added in v0.7.0

type LinkAvatarsPlugin struct {
	// contains filtered or unexported fields
}

LinkAvatarsPlugin adds favicon/avatar icons next to external links. It generates client-side JavaScript and CSS assets that enhance links at runtime in the browser.

func NewLinkAvatarsPlugin added in v0.7.0

func NewLinkAvatarsPlugin() *LinkAvatarsPlugin

NewLinkAvatarsPlugin creates a new LinkAvatarsPlugin.

func (*LinkAvatarsPlugin) Config added in v0.7.0

Config returns the current configuration (for testing).

func (*LinkAvatarsPlugin) Configure added in v0.7.0

func (p *LinkAvatarsPlugin) Configure(m *lifecycle.Manager) error

Configure loads plugin configuration from the manager.

func (*LinkAvatarsPlugin) Name added in v0.7.0

func (p *LinkAvatarsPlugin) Name() string

Name returns the unique name of the plugin.

func (*LinkAvatarsPlugin) Render added in v0.7.0

func (p *LinkAvatarsPlugin) Render(m *lifecycle.Manager) error

Render injects build-time avatars for local/hosted modes.

func (*LinkAvatarsPlugin) SetConfig added in v0.7.0

func (p *LinkAvatarsPlugin) SetConfig(config LinkAvatarsConfig)

SetConfig sets the link avatars configuration directly (for testing).

func (*LinkAvatarsPlugin) Write added in v0.7.0

Write generates the JavaScript and CSS assets.

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

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.

func NewLoadPlugin

func NewLoadPlugin() *LoadPlugin

NewLoadPlugin creates a new LoadPlugin.

func (*LoadPlugin) Load

func (p *LoadPlugin) Load(m *lifecycle.Manager) error

Load reads and parses all discovered files into Post objects. Files are loaded in parallel using a worker pool for improved I/O performance. Uses ModTime-based caching to skip re-parsing unchanged files.

func (*LoadPlugin) Name

func (p *LoadPlugin) Name() string

Name returns the plugin identifier.

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):

![Video description](video.mp4)

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==).

func NewMark added in v0.6.0

func NewMark() *Mark

NewMark creates a new Mark node.

func (*Mark) Dump added in v0.6.0

func (n *Mark) Dump(source []byte, level int)

Dump dumps the node for debugging.

func (*Mark) Kind added in v0.6.0

func (n *Mark) Kind() ast.NodeKind

Kind returns the kind of this node.

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 MarkdownExtensionConfig added in v0.7.0

type MarkdownExtensionConfig struct {
	TypographerEnabled       bool
	DefinitionListEnabled    bool
	FootnoteEnabled          bool
	CJKEnabled               bool
	FigureEnabled            bool
	AnchorEnabled            bool
	TypographerSubstitutions map[extension.TypographicPunctuation]string
}

MarkdownExtensionConfig holds configuration for optional markdown extensions.

func DefaultMarkdownExtensionConfig added in v0.7.0

func DefaultMarkdownExtensionConfig() MarkdownExtensionConfig

DefaultMarkdownExtensionConfig returns the default configuration with all extensions enabled.

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.

func (*MentionsPlugin) Priority added in v0.5.0

func (p *MentionsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage. Runs after blogroll has cached feed data in Collect stage.

func (*MentionsPlugin) Transform added in v0.5.0

func (p *MentionsPlugin) Transform(m *lifecycle.Manager) error

Transform processes @mentions in all post content.

type MermaidDependencyInfo added in v0.7.0

type MermaidDependencyInfo struct {
	Mode                string
	IsInstalled         bool
	BinaryPath          string
	InstalledVersion    string
	InstallInstructions string
	FallbackSuggestion  string
}

MermaidDependencyInfo provides information about a dependency and installation instructions

func ValidateMermaidMode added in v0.7.0

func ValidateMermaidMode(mode string, cliConfig *CLIConfig, chromiumConfig *ChromiumConfig) *MermaidDependencyInfo

ValidateMermaidMode validates the mermaid rendering mode and checks dependencies

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. It also validates that the selected rendering mode has its dependencies installed.

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) (err 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 OEmbedResponse added in v0.7.0

type OEmbedResponse struct {
	Type            string `json:"type"`
	Version         string `json:"version"`
	Title           string `json:"title"`
	URL             string `json:"url"`
	AuthorName      string `json:"author_name"`
	ProviderName    string `json:"provider_name"`
	ProviderURL     string `json:"provider_url"`
	ThumbnailURL    string `json:"thumbnail_url"`
	ThumbnailWidth  int    `json:"thumbnail_width"`
	ThumbnailHeight int    `json:"thumbnail_height"`
	HTML            string `json:"html"`
	Width           int    `json:"width"`
	Height          int    `json:"height"`
	CacheAge        int    `json:"cache_age"`
}

OEmbedResponse represents the JSON oEmbed response fields we care about. See: https://oembed.com

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"`
	Source      string `json:"source"`

	// Provider info for mode selection
	ProviderName string `json:"provider_name"`
	HTML         string `json:"html"` // oEmbed HTML for rich embeds
}

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

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

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

type PagefindInstallError struct {
	Operation string
	Message   string
	Err       error
}

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.

func (*PagefindPlugin) Priority added in v0.3.0

func (p *PagefindPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the cleanup stage. Pagefind runs last in cleanup to ensure all HTML files are written first.

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) Configure added in v0.7.0

func (p *PaletteCSSPlugin) Configure(m *lifecycle.Manager) error

Configure generates CSS from the configured palette and registers its hash so templates can use the correct hashed filename. This runs in Configure stage before templates are rendered in Render stage.

func (*PaletteCSSPlugin) Name

func (p *PaletteCSSPlugin) Name() string

Name returns the unique name of the plugin.

func (*PaletteCSSPlugin) Priority

func (p *PaletteCSSPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the write stage. Should run after static_assets so it can overwrite the default variables.css

func (*PaletteCSSPlugin) Write

func (p *PaletteCSSPlugin) Write(m *lifecycle.Manager) error

Write generates CSS from the configured palette and writes it to the output directory.

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.

func (*PrevNextPlugin) Priority

func (p *PrevNextPlugin) Priority(stage lifecycle.Stage) int

Priority ensures this plugin runs after the feeds 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

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.

func (*PublishHTMLPlugin) Write

Write outputs each post to the configured output directory in enabled formats.

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.

func (*QRCodePlugin) Write added in v0.2.0

func (p *QRCodePlugin) Write(m *lifecycle.Manager) error

Write generates QR code images for all posts.

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"`
	AtomLinks     []AtomLink `xml:"atom:link,omitempty"`
	Items         []RSSItem  `xml:"item"`
}

RSSChannel represents the channel element in an RSS feed.

type RSSGUID

type RSSGUID struct {
	Value       string `xml:",chardata"`
	IsPermaLink bool   `xml:"isPermaLink,attr"`
}

RSSGUID represents a globally unique identifier for an RSS item.

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 RandomPostConfig added in v0.7.0

type RandomPostConfig struct {
	// Enabled controls whether the plugin writes /random/ output.
	// Default: false
	Enabled bool

	// Path is the output path segment for the random endpoint.
	// Default: "random"
	Path string

	// EmitPostsJSON controls whether posts.json is also written.
	// Default: false
	EmitPostsJSON bool

	// ExcludeTags is a case-insensitive denylist of tags.
	ExcludeTags []string
}

RandomPostConfig holds configuration for the random_post plugin.

type RandomPostPlugin added in v0.7.0

type RandomPostPlugin struct {
	// contains filtered or unexported fields
}

RandomPostPlugin generates a static /random/ endpoint that redirects client-side to a random eligible post.

func NewRandomPostPlugin added in v0.7.0

func NewRandomPostPlugin() *RandomPostPlugin

NewRandomPostPlugin creates a new RandomPostPlugin.

func (*RandomPostPlugin) Configure added in v0.7.0

func (p *RandomPostPlugin) Configure(m *lifecycle.Manager) error

Configure loads plugin configuration from the manager.

func (*RandomPostPlugin) Name added in v0.7.0

func (p *RandomPostPlugin) Name() string

Name returns the unique name of the plugin.

func (*RandomPostPlugin) Write added in v0.7.0

func (p *RandomPostPlugin) Write(m *lifecycle.Manager) error

Write writes the random endpoint output files.

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.

func (*ReadingTimePlugin) Transform

func (p *ReadingTimePlugin) Transform(m *lifecycle.Manager) error

Transform calculates word count and reading time for each post.

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).

func (*RedirectsPlugin) Write

func (p *RedirectsPlugin) Write(m *lifecycle.Manager) error

Write generates redirect pages for each redirect rule.

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)

Markdown extension configuration: 1. markdown.extensions.typographer - Enable smart quotes (default: true) 2. markdown.extensions.definition_list - Enable definition lists (default: true) 3. markdown.extensions.footnote - Enable footnotes (default: true) 4. markdown.extensions.cjk - Enable CJK line breaks (default: true) 5. markdown.extensions.figure - Enable figure from images with captions (default: true) 6. markdown.extensions.anchor - Enable heading permalinks (default: true)

func (*RenderMarkdownPlugin) Name

func (p *RenderMarkdownPlugin) Name() string

Name returns the unique name of the plugin.

func (*RenderMarkdownPlugin) Render

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 ResourceHintsPlugin added in v0.7.0

type ResourceHintsPlugin struct {
	// contains filtered or unexported fields
}

ResourceHintsPlugin generates and injects resource hints (preconnect, dns-prefetch, etc.) into HTML files for improved network performance.

The plugin runs during the Write stage with late priority (after HTML files are written) to scan generated HTML for external resources and inject appropriate resource hints.

func NewResourceHintsPlugin added in v0.7.0

func NewResourceHintsPlugin() *ResourceHintsPlugin

NewResourceHintsPlugin creates a new ResourceHintsPlugin with default settings.

func (*ResourceHintsPlugin) Configure added in v0.7.0

func (p *ResourceHintsPlugin) Configure(m *lifecycle.Manager) error

Configure reads configuration options from config.ResourceHints.

func (*ResourceHintsPlugin) Name added in v0.7.0

func (p *ResourceHintsPlugin) Name() string

Name returns the unique name of the plugin.

func (*ResourceHintsPlugin) Priority added in v0.7.0

func (p *ResourceHintsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for the write stage. Returns a late priority to run after HTML files are written.

func (*ResourceHintsPlugin) Write added in v0.7.0

Write scans HTML files for external resources and injects resource hints. Each page gets hints only for domains detected on that specific page.

type SeriesPlugin added in v0.7.0

type SeriesPlugin struct{}

SeriesPlugin scans posts for `series` frontmatter and auto-generates series feed configs. It runs early in the Collect stage so that the feeds plugin can process the generated configs.

Processing Steps

  1. Scan all posts for `series` frontmatter
  2. Group posts by series name
  3. Sort posts within each series (by series_order or date ascending)
  4. Set guide navigation (Prev/Next) on each post
  5. Set PrevNextContext with position info
  6. Inject series FeedConfigs into config.Extra["feeds"]

func NewSeriesPlugin added in v0.7.0

func NewSeriesPlugin() *SeriesPlugin

NewSeriesPlugin creates a new SeriesPlugin.

func (*SeriesPlugin) Collect added in v0.7.0

func (p *SeriesPlugin) Collect(m *lifecycle.Manager) error

Collect scans posts for series frontmatter and injects series FeedConfigs.

func (*SeriesPlugin) Name added in v0.7.0

func (p *SeriesPlugin) Name() string

Name returns the unique name of the plugin.

func (*SeriesPlugin) Priority added in v0.7.0

func (p *SeriesPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage. Series runs early in Collect so feed configs are ready for the feeds plugin.

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

func GetSiteStats(m *lifecycle.Manager) *SiteStats

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.

func (*SitemapPlugin) Priority

func (p *SitemapPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. Sitemap should run late in the write stage, after all other content is written.

func (*SitemapPlugin) Write

func (p *SitemapPlugin) Write(m *lifecycle.Manager) error

Write generates and writes the sitemap.xml file.

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) Cleanup added in v0.7.0

func (p *StaticAssetsPlugin) Cleanup(m *lifecycle.Manager) error

Cleanup creates hashed copies of JS/CSS files after all Write plugins have run. This ensures the hashes match the final transformed content (after palette_css, minifiers, etc.)

func (*StaticAssetsPlugin) Configure added in v0.7.0

func (p *StaticAssetsPlugin) Configure(m *lifecycle.Manager) error

Configure computes content hashes for JS/CSS assets before templates are rendered. This enables cache busting via the theme_asset_hashed filter.

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.

func (*StaticAssetsPlugin) Write

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) Hashed copies are created in Cleanup stage after all transformations.

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

Collect checks for conflicts between generated and static files.

func (*StaticFileConflictsPlugin) Conflicts added in v0.6.0

Conflicts returns the detected conflicts.

func (*StaticFileConflictsPlugin) Name added in v0.6.0

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.

func (*StatsPlugin) Priority added in v0.5.0

func (p *StatsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. Stats should run early in transform (after content is loaded) and late in collect (after feeds are populated).

func (*StatsPlugin) Transform added in v0.5.0

func (p *StatsPlugin) Transform(m *lifecycle.Manager) error

Transform calculates statistics for each post.

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.

func (*StructuredDataPlugin) Priority added in v0.3.0

func (p *StructuredDataPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin priority for the given stage. Runs in mid-transform, after description plugin has run.

func (*StructuredDataPlugin) Transform added in v0.3.0

func (p *StructuredDataPlugin) Transform(m *lifecycle.Manager) error

Transform generates structured data for each post.

type SubscriptionFeedsPlugin added in v0.7.0

type SubscriptionFeedsPlugin struct{}

SubscriptionFeedsPlugin creates built-in subscription feeds at root and /archive. It generates /rss.xml, /atom.xml, /archive/rss.xml, /archive/atom.xml without creating HTML index pages.

This plugin also computes the discovery feed for each post during rendering, enabling dynamic <link rel="alternate"> tags based on the post's sidebar feed.

func NewSubscriptionFeedsPlugin added in v0.7.0

func NewSubscriptionFeedsPlugin() *SubscriptionFeedsPlugin

NewSubscriptionFeedsPlugin creates a new SubscriptionFeedsPlugin.

func (*SubscriptionFeedsPlugin) Collect added in v0.7.0

Collect injects built-in subscription feeds into the feed configs. These feeds generate RSS/Atom at root (/) and /archive without HTML pages.

func (*SubscriptionFeedsPlugin) Name added in v0.7.0

func (p *SubscriptionFeedsPlugin) Name() string

Name returns the unique name of the plugin.

func (*SubscriptionFeedsPlugin) Priority added in v0.7.0

func (p *SubscriptionFeedsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage.

type TagAggregatorPlugin added in v0.7.0

type TagAggregatorPlugin struct {
	// contains filtered or unexported fields
}

TagAggregatorPlugin normalizes tags using synonyms and expands them with hierarchical relationships.

Features: - Synonym normalization: Replace variant tag names with canonical tags (e.g., "k8s" -> "kubernetes") - Hierarchical expansion: Automatically add parent/related tags (e.g., "pandas" adds "data" and "python") - Recursive expansion: Additional tags are applied recursively to build complete tag hierarchies

This plugin runs in the Load stage with priority 50 (after posts are loaded but before AutoFeedsPlugin at PriorityLate=100) so that expanded tags are visible to auto-generated tag feeds.

func NewTagAggregatorPlugin added in v0.7.0

func NewTagAggregatorPlugin() *TagAggregatorPlugin

NewTagAggregatorPlugin creates a new tag aggregator plugin.

func (*TagAggregatorPlugin) Configure added in v0.7.0

func (p *TagAggregatorPlugin) Configure(m *lifecycle.Manager) error

Configure stores the manager reference.

func (*TagAggregatorPlugin) Load added in v0.7.0

Load normalizes and expands tags for all posts. This runs in the Load stage so expanded tags are visible to auto-generated feeds.

func (*TagAggregatorPlugin) Name added in v0.7.0

func (p *TagAggregatorPlugin) Name() string

Name returns the plugin name.

func (*TagAggregatorPlugin) Priority added in v0.7.0

func (p *TagAggregatorPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage. We run in Load stage with priority 50 - after posts are loaded (default=0) but before AutoFeedsPlugin (PriorityLate=100) creates tag feeds.

type TagCluster added in v0.7.0

type TagCluster struct {
	// Name is the tag name
	Name string

	// Count is the number of posts with this tag
	Count int

	// Href is the URL to the tag page
	Href string

	// Related is the list of related tags (by co-occurrence)
	Related []TagRelation
}

TagCluster represents a tag and its related tags for the garden template.

type TagInfo added in v0.7.0

type TagInfo struct {
	// Name is the display name of the tag
	Name string

	// Slug is the URL-safe slug of the tag
	Slug string

	// Count is the number of posts with this tag
	Count int

	// Href is the URL to the tag page
	Href string
}

TagInfo represents information about a single tag for the tags listing page.

type TagRelation added in v0.7.0

type TagRelation struct {
	// Name is the related tag name
	Name string

	// Count is the number of posts shared with the tag
	Count int

	// Href is the URL to the related tag page
	Href string
}

TagRelation represents a related tag with co-occurrence weight.

type TagStats added in v0.7.0

type TagStats struct {
	Tag             string // The tag name
	Slug            string // URL-safe slug
	Count           int    // Number of posts with this tag
	ReadingTime     int    // Total reading time (minutes)
	ReadingTimeText string // Formatted reading time text
}

TagStats holds statistics about a tag.

type TagsListingPlugin added in v0.7.0

type TagsListingPlugin struct {
	// contains filtered or unexported fields
}

TagsListingPlugin generates a tags listing page at /tags showing all available tags. It supports blacklist and private tag configurations to control tag visibility.

func NewTagsListingPlugin added in v0.7.0

func NewTagsListingPlugin() *TagsListingPlugin

NewTagsListingPlugin creates a new TagsListingPlugin.

func (*TagsListingPlugin) Name added in v0.7.0

func (p *TagsListingPlugin) Name() string

Name returns the unique name of the plugin.

func (*TagsListingPlugin) Priority added in v0.7.0

func (p *TagsListingPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage.

func (*TagsListingPlugin) Write added in v0.7.0

Write generates the tags listing page.

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 ThemeCalendarPlugin added in v0.7.0

type ThemeCalendarPlugin struct {
	// contains filtered or unexported fields
}

ThemeCalendarPlugin applies theme rules based on the current date. It runs during the Configure stage to modify theme settings based on date-based rules defined in the configuration.

Configuration example:

[markata-go.theme_calendar]
enabled = true

[[markata-go.theme_calendar.rules]]
name = "Christmas Season"
start_date = "12-15"
end_date = "12-26"
palette = "christmas"

[[markata-go.theme_calendar.rules]]
name = "Winter Frost"
start_date = "12-01"
end_date = "02-28"
palette = "winter-frost"

func NewThemeCalendarPlugin added in v0.7.0

func NewThemeCalendarPlugin() *ThemeCalendarPlugin

NewThemeCalendarPlugin creates a new ThemeCalendarPlugin.

func (*ThemeCalendarPlugin) Configure added in v0.7.0

func (p *ThemeCalendarPlugin) Configure(m *lifecycle.Manager) error

Configure checks date-based theme rules and applies matching overrides.

func (*ThemeCalendarPlugin) Name added in v0.7.0

func (p *ThemeCalendarPlugin) Name() string

Name returns the unique name of the plugin.

func (*ThemeCalendarPlugin) Priority added in v0.7.0

func (p *ThemeCalendarPlugin) Priority(stage lifecycle.Stage) int

Priority returns a high priority so theme calendar runs before other theme plugins. This ensures the theme is configured before palette_css and other plugins process it.

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) Configure

func (p *TocPlugin) Configure(m *lifecycle.Manager) error

Configure reads configuration options for the plugin.

func (*TocPlugin) Name

func (p *TocPlugin) Name() string

Name returns the unique name of the plugin.

func (*TocPlugin) SetLevelRange

func (p *TocPlugin) SetLevelRange(minLevel, maxLevel int)

SetLevelRange sets the minimum and maximum heading levels to include.

func (*TocPlugin) Transform

func (p *TocPlugin) Transform(m *lifecycle.Manager) error

Transform extracts headings from markdown and builds a TOC for each post.

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.

func (*WebMentionsPlugin) Priority added in v0.5.0

func (p *WebMentionsPlugin) Priority(stage lifecycle.Stage) int

Priority returns the plugin's priority for a given stage.

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).

func (*WebmentionsFetchPlugin) Transform added in v0.6.0

func (p *WebmentionsFetchPlugin) Transform(m *lifecycle.Manager) error

Transform loads cached webmentions and attaches them to posts.

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

Name returns the unique name of the plugin.

func (*WebmentionsLeaderboardPlugin) Priority added in v0.6.0

func (p *WebmentionsLeaderboardPlugin) Priority(stage lifecycle.Stage) int

Priority returns the execution priority for this plugin. Run after webmentions_fetch (-200) but before jinja_md (-100).

func (*WebmentionsLeaderboardPlugin) Transform added in v0.6.0

Transform calculates the webmention leaderboard and stores it in config.

type WellKnownPlugin added in v0.7.0

type WellKnownPlugin struct {
	// contains filtered or unexported fields
}

WellKnownPlugin generates .well-known endpoints from site metadata.

func NewWellKnownPlugin added in v0.7.0

func NewWellKnownPlugin() *WellKnownPlugin

NewWellKnownPlugin creates a new WellKnownPlugin.

func (*WellKnownPlugin) Name added in v0.7.0

func (p *WellKnownPlugin) Name() string

Name returns the unique name of the plugin.

func (*WellKnownPlugin) Write added in v0.7.0

func (p *WellKnownPlugin) Write(m *lifecycle.Manager) error

Write generates .well-known files during the write stage.

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

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

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.

func (*WikilinksPlugin) Transform

func (p *WikilinksPlugin) Transform(m *lifecycle.Manager) error

Transform processes wikilinks in all post content.

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.

Jump to

Keyboard shortcuts

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