models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlternateFeed added in v0.3.0

type AlternateFeed struct {
	// Type is the feed type: "rss", "atom", or "json"
	Type string `json:"type" yaml:"type" toml:"type"`

	// Title is the human-readable feed title (e.g., "RSS Feed")
	Title string `json:"title" yaml:"title" toml:"title"`

	// Href is the URL path to the feed (e.g., "/rss.xml")
	Href string `json:"href" yaml:"href" toml:"href"`
}

AlternateFeed configures a <link rel="alternate"> tag for feed discovery.

func (*AlternateFeed) GetMIMEType added in v0.3.0

func (f *AlternateFeed) GetMIMEType() string

GetMIMEType returns the MIME type for this feed type.

type BlogPosting added in v0.3.0

type BlogPosting struct {
	Context          string       `json:"@context"`
	Type             string       `json:"@type"`
	Headline         string       `json:"headline"`
	Description      string       `json:"description,omitempty"`
	DatePublished    string       `json:"datePublished,omitempty"`
	DateModified     string       `json:"dateModified,omitempty"`
	Author           *SchemaAgent `json:"author,omitempty"`
	Publisher        *SchemaAgent `json:"publisher,omitempty"`
	MainEntityOfPage *WebPage     `json:"mainEntityOfPage,omitempty"`
	Image            string       `json:"image,omitempty"`
	Keywords         []string     `json:"keywords,omitempty"`
	URL              string       `json:"url,omitempty"`
}

BlogPosting represents a Schema.org BlogPosting for JSON-LD.

func NewBlogPosting added in v0.3.0

func NewBlogPosting(headline, url string) *BlogPosting

NewBlogPosting creates a new BlogPosting with required fields.

type CSVFenceConfig

type CSVFenceConfig struct {
	// Enabled controls whether CSV blocks are converted to tables (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// TableClass is the CSS class for generated tables (default: "csv-table")
	TableClass string `json:"table_class" yaml:"table_class" toml:"table_class"`

	// HasHeader indicates whether the first row is a header (default: true)
	HasHeader bool `json:"has_header" yaml:"has_header" toml:"has_header"`

	// Delimiter is the CSV field delimiter (default: ",")
	Delimiter string `json:"delimiter" yaml:"delimiter" toml:"delimiter"`
}

CSVFenceConfig configures the csv_fence plugin.

func NewCSVFenceConfig

func NewCSVFenceConfig() CSVFenceConfig

NewCSVFenceConfig creates a new CSVFenceConfig with default values.

type ChartJSConfig added in v0.2.0

type ChartJSConfig struct {
	// Enabled controls whether Chart.js processing is active (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// CDNURL is the URL for the Chart.js library
	CDNURL string `json:"cdn_url" yaml:"cdn_url" toml:"cdn_url"`

	// ContainerClass is the CSS class for the chart container div (default: "chartjs-container")
	ContainerClass string `json:"container_class" yaml:"container_class" toml:"container_class"`
}

ChartJSConfig configures the chartjs plugin.

func NewChartJSConfig added in v0.2.0

func NewChartJSConfig() ChartJSConfig

NewChartJSConfig creates a new ChartJSConfig with default values.

type ComponentsConfig added in v0.3.0

type ComponentsConfig struct {
	// Nav configures the navigation component
	Nav NavComponentConfig `json:"nav" yaml:"nav" toml:"nav"`

	// Footer configures the footer component
	Footer FooterComponentConfig `json:"footer" yaml:"footer" toml:"footer"`

	// DocSidebar configures the document sidebar (table of contents)
	DocSidebar DocSidebarConfig `json:"doc_sidebar" yaml:"doc_sidebar" toml:"doc_sidebar"`

	// FeedSidebar configures the feed sidebar (series/collection navigation)
	FeedSidebar FeedSidebarConfig `json:"feed_sidebar" yaml:"feed_sidebar" toml:"feed_sidebar"`
}

ComponentsConfig configures the layout components system. This enables configuration-driven control over common UI elements.

func NewComponentsConfig added in v0.3.0

func NewComponentsConfig() ComponentsConfig

NewComponentsConfig creates a new ComponentsConfig with default values.

func (*ComponentsConfig) IsDocSidebarEnabled added in v0.3.0

func (c *ComponentsConfig) IsDocSidebarEnabled() bool

IsDocSidebarEnabled returns whether the document sidebar is enabled.

func (*ComponentsConfig) IsFeedSidebarEnabled added in v0.3.0

func (c *ComponentsConfig) IsFeedSidebarEnabled() bool

IsFeedSidebarEnabled returns whether the feed sidebar is enabled.

func (*ComponentsConfig) IsFooterEnabled added in v0.3.0

func (c *ComponentsConfig) IsFooterEnabled() bool

IsFooterEnabled returns whether footer is enabled.

func (*ComponentsConfig) IsNavEnabled added in v0.3.0

func (c *ComponentsConfig) IsNavEnabled() bool

IsNavEnabled returns whether navigation is enabled.

type Config

type Config struct {
	// OutputDir is the directory where generated files are written (default: "output")
	OutputDir string `json:"output_dir" yaml:"output_dir" toml:"output_dir"`

	// URL is the base URL of the site
	URL string `json:"url" yaml:"url" toml:"url"`

	// Title is the site title
	Title string `json:"title" yaml:"title" toml:"title"`

	// Description is the site description
	Description string `json:"description" yaml:"description" toml:"description"`

	// Author is the site author
	Author string `json:"author" yaml:"author" toml:"author"`

	// AssetsDir is the directory containing static assets (default: "static")
	AssetsDir string `json:"assets_dir" yaml:"assets_dir" toml:"assets_dir"`

	// TemplatesDir is the directory containing templates (default: "templates")
	TemplatesDir string `json:"templates_dir" yaml:"templates_dir" toml:"templates_dir"`

	// Nav is the list of navigation links
	Nav []NavItem `json:"nav" yaml:"nav" toml:"nav"`

	// Footer configures the site footer
	Footer FooterConfig `json:"footer" yaml:"footer" toml:"footer"`

	// Hooks is the list of hooks to run (default: ["default"])
	Hooks []string `json:"hooks" yaml:"hooks" toml:"hooks"`

	// DisabledHooks is the list of hooks to disable
	DisabledHooks []string `json:"disabled_hooks" yaml:"disabled_hooks" toml:"disabled_hooks"`

	// GlobConfig configures file globbing behavior
	GlobConfig GlobConfig `json:"glob" yaml:"glob" toml:"glob"`

	// MarkdownConfig configures markdown processing
	MarkdownConfig MarkdownConfig `json:"markdown" yaml:"markdown" toml:"markdown"`

	// Feeds is the list of feed configurations
	Feeds []FeedConfig `json:"feeds" yaml:"feeds" toml:"feeds"`

	// FeedDefaults provides default values for feed configurations
	FeedDefaults FeedDefaults `json:"feed_defaults" yaml:"feed_defaults" toml:"feed_defaults"`

	// Concurrency is the number of concurrent workers (default: 0 = auto)
	Concurrency int `json:"concurrency" yaml:"concurrency" toml:"concurrency"`

	// Theme configures the site theme
	Theme ThemeConfig `json:"theme" yaml:"theme" toml:"theme"`

	// PostFormats configures output formats for individual posts
	PostFormats PostFormatsConfig `json:"post_formats" yaml:"post_formats" toml:"post_formats"`

	// SEO configures SEO metadata generation
	SEO SEOConfig `json:"seo" yaml:"seo" toml:"seo"`

	// IndieAuth configures IndieAuth link tags for identity and authentication
	IndieAuth IndieAuthConfig `json:"indieauth" yaml:"indieauth" toml:"indieauth"`

	// Webmention configures Webmention endpoint for receiving mentions
	Webmention WebmentionConfig `json:"webmention" yaml:"webmention" toml:"webmention"`

	// Components configures layout components (nav, footer, sidebar)
	Components ComponentsConfig `json:"components" yaml:"components" toml:"components"`

	// Head configures elements added to the HTML <head> section
	Head HeadConfig `json:"head" yaml:"head" toml:"head"`

	// Search configures site-wide search functionality using Pagefind
	Search SearchConfig `json:"search" yaml:"search" toml:"search"`
}

Config represents the site configuration for markata-go.

func NewConfig

func NewConfig() *Config

NewConfig creates a new Config with default values.

func (*Config) IsHookEnabled

func (c *Config) IsHookEnabled(name string) bool

IsHookEnabled checks if a hook is enabled (in Hooks and not in DisabledHooks).

type ConfigValidationError

type ConfigValidationError struct {
	Field   string
	Value   interface{}
	Message string
}

ConfigValidationError indicates a configuration validation error.

func NewConfigValidationError

func NewConfigValidationError(field string, value interface{}, message string) *ConfigValidationError

NewConfigValidationError creates a new ConfigValidationError.

func (*ConfigValidationError) Error

func (e *ConfigValidationError) Error() string

type DocSidebarConfig added in v0.3.0

type DocSidebarConfig struct {
	// Enabled controls whether the TOC sidebar is displayed (default: false)
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`

	// Position controls sidebar position: "left", "right" (default: "right")
	Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`

	// Width is the sidebar width (default: "250px")
	Width string `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`

	// MinDepth is the minimum heading level to include (default: 2)
	MinDepth int `json:"min_depth,omitempty" yaml:"min_depth,omitempty" toml:"min_depth,omitempty"`

	// MaxDepth is the maximum heading level to include (default: 4)
	MaxDepth int `json:"max_depth,omitempty" yaml:"max_depth,omitempty" toml:"max_depth,omitempty"`
}

DocSidebarConfig configures the document sidebar (table of contents).

type EntityConfig added in v0.3.0

type EntityConfig struct {
	// Type is "Person" or "Organization" (default: "Organization")
	Type string `json:"type" yaml:"type" toml:"type"`

	// Name is the entity name
	Name string `json:"name" yaml:"name" toml:"name"`

	// URL is the entity's web page
	URL string `json:"url,omitempty" yaml:"url,omitempty" toml:"url,omitempty"`

	Logo string `json:"logo,omitempty" yaml:"logo,omitempty" toml:"logo,omitempty"`
}

EntityConfig represents a Schema.org Person or Organization entity.

type FeedConfig

type FeedConfig struct {
	// Slug is the URL-safe identifier for the feed
	Slug string `json:"slug" yaml:"slug" toml:"slug"`

	// Title is the feed title
	Title string `json:"title" yaml:"title" toml:"title"`

	// Description is the feed description
	Description string `json:"description" yaml:"description" toml:"description"`

	// Filter is the filter expression for selecting posts
	Filter string `json:"filter" yaml:"filter" toml:"filter"`

	// Sort is the field to sort posts by
	Sort string `json:"sort" yaml:"sort" toml:"sort"`

	// Reverse indicates if the sort order should be reversed
	Reverse bool `json:"reverse" yaml:"reverse" toml:"reverse"`

	// ItemsPerPage is the number of items per page (default: 10)
	ItemsPerPage int `json:"items_per_page" yaml:"items_per_page" toml:"items_per_page"`

	// OrphanThreshold is the minimum number of items for a separate page (default: 3)
	OrphanThreshold int `json:"orphan_threshold" yaml:"orphan_threshold" toml:"orphan_threshold"`

	// PaginationType specifies the pagination strategy (manual, htmx, js)
	PaginationType PaginationType `json:"pagination_type" yaml:"pagination_type" toml:"pagination_type"`

	// Formats specifies which output formats to generate
	Formats FeedFormats `json:"formats" yaml:"formats" toml:"formats"`

	// Templates specifies custom templates for each format
	Templates FeedTemplates `json:"templates" yaml:"templates" toml:"templates"`

	// Posts holds the filtered posts at runtime (not serialized)
	Posts []*Post `json:"-" yaml:"-" toml:"-"`

	// Pages holds the paginated results at runtime (not serialized)
	Pages []FeedPage `json:"-" yaml:"-" toml:"-"`
}

FeedConfig represents a feed configuration.

func NewFeedConfig

func NewFeedConfig(defaults FeedDefaults) *FeedConfig

NewFeedConfig creates a new FeedConfig with default values from FeedDefaults.

func (*FeedConfig) ApplyDefaults

func (f *FeedConfig) ApplyDefaults(defaults FeedDefaults)

ApplyDefaults applies default values from FeedDefaults to a FeedConfig for any fields that are not explicitly set.

func (*FeedConfig) Paginate

func (f *FeedConfig) Paginate(baseURL string)

Paginate divides the Posts slice into pages based on ItemsPerPage and OrphanThreshold.

type FeedDefaults

type FeedDefaults struct {
	// ItemsPerPage is the default number of items per page
	ItemsPerPage int `json:"items_per_page" yaml:"items_per_page" toml:"items_per_page"`

	// OrphanThreshold is the default minimum number of items for a separate page
	OrphanThreshold int `json:"orphan_threshold" yaml:"orphan_threshold" toml:"orphan_threshold"`

	// PaginationType is the default pagination strategy
	PaginationType PaginationType `json:"pagination_type" yaml:"pagination_type" toml:"pagination_type"`

	// Formats specifies the default output formats
	Formats FeedFormats `json:"formats" yaml:"formats" toml:"formats"`

	// Templates specifies the default templates
	Templates FeedTemplates `json:"templates" yaml:"templates" toml:"templates"`

	// Syndication configures syndication feed behavior
	Syndication SyndicationConfig `json:"syndication" yaml:"syndication" toml:"syndication"`
}

FeedDefaults provides default values that feeds inherit.

func NewFeedDefaults

func NewFeedDefaults() FeedDefaults

NewFeedDefaults creates FeedDefaults with sensible default values.

type FeedFormats

type FeedFormats struct {
	// HTML generates an HTML page
	HTML bool `json:"html" yaml:"html" toml:"html"`

	// RSS generates an RSS feed
	RSS bool `json:"rss" yaml:"rss" toml:"rss"`

	// Atom generates an Atom feed
	Atom bool `json:"atom" yaml:"atom" toml:"atom"`

	// JSON generates a JSON feed
	JSON bool `json:"json" yaml:"json" toml:"json"`

	// Markdown generates a Markdown file
	Markdown bool `json:"markdown" yaml:"markdown" toml:"markdown"`

	// Text generates a plain text file
	Text bool `json:"text" yaml:"text" toml:"text"`
}

FeedFormats specifies which output formats to generate for a feed.

func (FeedFormats) HasAnyEnabled

func (f FeedFormats) HasAnyEnabled() bool

HasAnyEnabled returns true if any output format is enabled.

type FeedPage

type FeedPage struct {
	// Number is the page number (1-indexed)
	Number int `json:"number" yaml:"number" toml:"number"`

	// Posts is the list of posts on this page
	Posts []*Post `json:"posts" yaml:"posts" toml:"posts"`

	// HasPrev indicates if there is a previous page
	HasPrev bool `json:"has_prev" yaml:"has_prev" toml:"has_prev"`

	// HasNext indicates if there is a next page
	HasNext bool `json:"has_next" yaml:"has_next" toml:"has_next"`

	// PrevURL is the URL of the previous page
	PrevURL string `json:"prev_url" yaml:"prev_url" toml:"prev_url"`

	// NextURL is the URL of the next page
	NextURL string `json:"next_url" yaml:"next_url" toml:"next_url"`

	// TotalPages is the total number of pages in the feed
	TotalPages int `json:"total_pages" yaml:"total_pages" toml:"total_pages"`

	// TotalItems is the total number of posts in the feed
	TotalItems int `json:"total_items" yaml:"total_items" toml:"total_items"`

	// ItemsPerPage is the number of posts per page
	ItemsPerPage int `json:"items_per_page" yaml:"items_per_page" toml:"items_per_page"`

	// PageURLs contains URLs for all pages (for numbered pagination)
	PageURLs []string `json:"page_urls" yaml:"page_urls" toml:"page_urls"`

	// PaginationType is the pagination strategy used
	PaginationType PaginationType `json:"pagination_type" yaml:"pagination_type" toml:"pagination_type"`
}

FeedPage represents a single page of paginated feed results.

type FeedSidebarConfig added in v0.3.0

type FeedSidebarConfig struct {
	// Enabled controls whether the feed sidebar is displayed (default: false)
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`

	// Position controls sidebar position: "left", "right" (default: "left")
	Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`

	// Width is the sidebar width (default: "250px")
	Width string `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`

	// Title is the sidebar title (default: uses feed title or "In this series")
	Title string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`

	// Feeds is the list of feed slugs to show navigation for
	Feeds []string `json:"feeds,omitempty" yaml:"feeds,omitempty" toml:"feeds,omitempty"`
}

FeedSidebarConfig configures the feed sidebar (series/collection navigation).

type FeedTemplates

type FeedTemplates struct {
	// HTML is the template for HTML output
	HTML string `json:"html" yaml:"html" toml:"html"`

	// RSS is the template for RSS output
	RSS string `json:"rss" yaml:"rss" toml:"rss"`

	// Atom is the template for Atom output
	Atom string `json:"atom" yaml:"atom" toml:"atom"`

	// JSON is the template for JSON output
	JSON string `json:"json" yaml:"json" toml:"json"`

	// Card is the template for individual post cards
	Card string `json:"card" yaml:"card" toml:"card"`
}

FeedTemplates specifies custom templates for feed formats.

type FilterExpressionError

type FilterExpressionError struct {
	Expression string
	Position   int
	Message    string
	Err        error
}

FilterExpressionError indicates an error in a filter expression.

func NewFilterExpressionError

func NewFilterExpressionError(expression, message string, err error) *FilterExpressionError

NewFilterExpressionError creates a new FilterExpressionError.

func (*FilterExpressionError) Error

func (e *FilterExpressionError) Error() string

func (*FilterExpressionError) Unwrap

func (e *FilterExpressionError) Unwrap() error

type FooterComponentConfig added in v0.3.0

type FooterComponentConfig struct {
	// Enabled controls whether footer is displayed (default: true)
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`

	// Text is the footer text (supports template variables)
	Text string `json:"text,omitempty" yaml:"text,omitempty" toml:"text,omitempty"`

	// ShowCopyright shows the copyright line (default: true)
	ShowCopyright *bool `json:"show_copyright,omitempty" yaml:"show_copyright,omitempty" toml:"show_copyright,omitempty"`

	// Links are additional footer links
	Links []NavItem `json:"links,omitempty" yaml:"links,omitempty" toml:"links,omitempty"`
}

FooterComponentConfig configures the footer component.

type FooterConfig added in v0.3.0

type FooterConfig struct {
	// Text is the footer text (supports template variables like {{ year }})
	Text string `json:"text,omitempty" yaml:"text,omitempty" toml:"text,omitempty"`

	// ShowCopyright shows the copyright line (default: true)
	ShowCopyright *bool `json:"show_copyright,omitempty" yaml:"show_copyright,omitempty" toml:"show_copyright,omitempty"`
}

FooterConfig configures the site footer.

type FrontmatterParseError

type FrontmatterParseError struct {
	Path    string
	Line    int
	Message string
	Err     error
}

FrontmatterParseError indicates an error parsing frontmatter from a post.

func NewFrontmatterParseError

func NewFrontmatterParseError(path, message string, err error) *FrontmatterParseError

NewFrontmatterParseError creates a new FrontmatterParseError.

func (*FrontmatterParseError) Error

func (e *FrontmatterParseError) Error() string

func (*FrontmatterParseError) Unwrap

func (e *FrontmatterParseError) Unwrap() error

type GlobConfig

type GlobConfig struct {
	// Patterns is the list of glob patterns to match source files
	Patterns []string `json:"patterns" yaml:"patterns" toml:"patterns"`

	// UseGitignore determines whether to respect .gitignore files
	UseGitignore bool `json:"use_gitignore" yaml:"use_gitignore" toml:"use_gitignore"`
}

GlobConfig configures file globbing behavior.

type HeadConfig added in v0.3.0

type HeadConfig struct {
	// Text is raw HTML/text to include in the head (use with caution)
	Text string `json:"text,omitempty" yaml:"text,omitempty" toml:"text,omitempty"`

	// Meta is a list of meta tags to include
	Meta []MetaTag `json:"meta,omitempty" yaml:"meta,omitempty" toml:"meta,omitempty"`

	// Link is a list of link tags to include
	Link []LinkTag `json:"link,omitempty" yaml:"link,omitempty" toml:"link,omitempty"`

	// Script is a list of script tags to include
	Script []ScriptTag `json:"script,omitempty" yaml:"script,omitempty" toml:"script,omitempty"`

	// AlternateFeeds configures which feeds get <link rel="alternate"> tags
	// If empty, defaults to RSS and Atom feeds
	AlternateFeeds []AlternateFeed `json:"alternate_feeds,omitempty" yaml:"alternate_feeds,omitempty" toml:"alternate_feeds,omitempty"`
}

HeadConfig configures elements added to the HTML <head> section.

type HighlightConfig

type HighlightConfig struct {
	// Enabled controls whether syntax highlighting is active (default: true)
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`

	// Theme is the Chroma theme to use for syntax highlighting.
	// If empty, the theme is automatically derived from the site's color palette.
	// See https://xyproto.github.io/splash/docs/ for available themes.
	Theme string `json:"theme,omitempty" yaml:"theme,omitempty" toml:"theme,omitempty"`

	// LineNumbers enables line numbers in code blocks (default: false)
	LineNumbers bool `json:"line_numbers" yaml:"line_numbers" toml:"line_numbers"`
}

HighlightConfig configures syntax highlighting for code blocks.

func NewHighlightConfig

func NewHighlightConfig() HighlightConfig

NewHighlightConfig creates a new HighlightConfig with default values.

func (*HighlightConfig) IsEnabled

func (h *HighlightConfig) IsEnabled() bool

IsEnabled returns whether syntax highlighting is enabled. Defaults to true if not explicitly set.

type ImageObject added in v0.3.0

type ImageObject struct {
	Type string `json:"@type"`
	URL  string `json:"url"`
}

ImageObject represents a Schema.org ImageObject.

type IndieAuthConfig added in v0.3.0

type IndieAuthConfig struct {
	// Enabled controls whether IndieAuth link tags are included (default: false)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// AuthorizationEndpoint is the URL of your authorization endpoint
	// Example: "https://indieauth.com/auth"
	AuthorizationEndpoint string `json:"authorization_endpoint" yaml:"authorization_endpoint" toml:"authorization_endpoint"`

	// TokenEndpoint is the URL of your token endpoint
	// Example: "https://tokens.indieauth.com/token"
	TokenEndpoint string `json:"token_endpoint" yaml:"token_endpoint" toml:"token_endpoint"`

	// MeURL is your profile URL for rel="me" links (optional)
	// This links your site to other profiles (GitHub, Twitter, etc.)
	MeURL string `json:"me_url" yaml:"me_url" toml:"me_url"`
}

IndieAuthConfig configures IndieAuth link tags for identity and authentication. IndieAuth is a decentralized authentication protocol built on OAuth 2.0. See https://indieauth.spec.indieweb.org/ for the specification.

func NewIndieAuthConfig added in v0.3.0

func NewIndieAuthConfig() IndieAuthConfig

NewIndieAuthConfig creates a new IndieAuthConfig with default values.

type Link struct {
	// SourceURL is the absolute URL of the source post
	SourceURL string `json:"source_url" yaml:"source_url" toml:"source_url"`

	// SourcePost is a reference to the source post object
	SourcePost *Post `json:"-" yaml:"-" toml:"-"`

	// TargetPost is a reference to the target post (nil if external)
	TargetPost *Post `json:"-" yaml:"-" toml:"-"`

	// RawTarget is the original href value as found in the HTML
	RawTarget string `json:"raw_target" yaml:"raw_target" toml:"raw_target"`

	// TargetURL is the resolved absolute URL
	TargetURL string `json:"target_url" yaml:"target_url" toml:"target_url"`

	// TargetDomain is the domain extracted from target_url
	TargetDomain string `json:"target_domain" yaml:"target_domain" toml:"target_domain"`

	// IsInternal is true if the link points to the same site
	IsInternal bool `json:"is_internal" yaml:"is_internal" toml:"is_internal"`

	// IsSelf is true if the link points to the same post
	IsSelf bool `json:"is_self" yaml:"is_self" toml:"is_self"`

	// SourceText is the cleaned link text from the source anchor
	SourceText string `json:"source_text" yaml:"source_text" toml:"source_text"`

	// TargetText is the cleaned link text from the target (if available)
	TargetText string `json:"target_text" yaml:"target_text" toml:"target_text"`
}

Link represents a hyperlink found in a post's HTML content. It tracks both the source (where the link is from) and target (where it points to).

func NewLink(sourceURL, rawTarget, targetURL, targetDomain string, isInternal bool) *Link

NewLink creates a new Link with the given source and target information.

func (*Link) SourceSlug

func (l *Link) SourceSlug() string

SourceSlug returns the slug of the source post, or empty string if nil.

func (*Link) SourceTitle

func (l *Link) SourceTitle() string

SourceTitle returns the title of the source post, or empty string if nil.

func (*Link) TargetSlug

func (l *Link) TargetSlug() string

TargetSlug returns the slug of the target post, or empty string if nil.

func (*Link) TargetTitle

func (l *Link) TargetTitle() string

TargetTitle returns the title of the target post, or empty string if nil.

type LinkTag added in v0.3.0

type LinkTag struct {
	Rel         string `json:"rel" yaml:"rel" toml:"rel"`
	Href        string `json:"href" yaml:"href" toml:"href"`
	Crossorigin bool   `json:"crossorigin,omitempty" yaml:"crossorigin,omitempty" toml:"crossorigin,omitempty"`
}

LinkTag represents a <link> tag configuration.

type MDVideoConfig

type MDVideoConfig struct {
	// Enabled controls whether video conversion is active (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// VideoExtensions is the list of file extensions to treat as videos
	VideoExtensions []string `json:"video_extensions" yaml:"video_extensions" toml:"video_extensions"`

	// VideoClass is the CSS class added to video elements (default: "md-video")
	VideoClass string `json:"video_class" yaml:"video_class" toml:"video_class"`

	// Controls shows video controls (default: true)
	Controls bool `json:"controls" yaml:"controls" toml:"controls"`

	// Autoplay starts video automatically (default: true for GIF-like behavior)
	Autoplay bool `json:"autoplay" yaml:"autoplay" toml:"autoplay"`

	// Loop repeats the video (default: true for GIF-like behavior)
	Loop bool `json:"loop" yaml:"loop" toml:"loop"`

	// Muted mutes the video (default: true, required for autoplay in most browsers)
	Muted bool `json:"muted" yaml:"muted" toml:"muted"`

	// Playsinline enables inline playback on mobile (default: true)
	Playsinline bool `json:"playsinline" yaml:"playsinline" toml:"playsinline"`

	// Preload hints how much to preload: "none", "metadata", "auto" (default: "metadata")
	Preload string `json:"preload" yaml:"preload" toml:"preload"`
}

MDVideoConfig configures the md_video plugin.

func NewMDVideoConfig

func NewMDVideoConfig() MDVideoConfig

NewMDVideoConfig creates a new MDVideoConfig with sensible defaults. Default behavior is GIF-like: autoplay, loop, muted, with controls available.

type MarkdownConfig

type MarkdownConfig struct {
	// Extensions is the list of markdown extensions to enable
	Extensions []string `json:"extensions" yaml:"extensions" toml:"extensions"`

	// Highlight configures syntax highlighting for code blocks
	Highlight HighlightConfig `json:"highlight" yaml:"highlight" toml:"highlight"`
}

MarkdownConfig configures markdown processing.

type MermaidConfig

type MermaidConfig struct {
	// Enabled controls whether mermaid processing is active (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// CDNURL is the URL for the Mermaid.js library
	CDNURL string `json:"cdn_url" yaml:"cdn_url" toml:"cdn_url"`

	// Theme is the Mermaid theme to use (default, dark, forest, neutral)
	Theme string `json:"theme" yaml:"theme" toml:"theme"`
}

MermaidConfig configures the mermaid plugin.

func NewMermaidConfig

func NewMermaidConfig() MermaidConfig

NewMermaidConfig creates a new MermaidConfig with default values.

type MetaTag added in v0.3.0

type MetaTag struct {
	Name     string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
	Property string `json:"property,omitempty" yaml:"property,omitempty" toml:"property,omitempty"`
	Content  string `json:"content" yaml:"content" toml:"content"`
}

MetaTag represents a <meta> tag configuration.

type NavComponentConfig struct {
	// Enabled controls whether navigation is displayed (default: true)
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`

	// Position controls where navigation appears: "header", "sidebar" (default: "header")
	Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`

	// Style controls the navigation style: "horizontal", "vertical" (default: "horizontal")
	Style string `json:"style,omitempty" yaml:"style,omitempty" toml:"style,omitempty"`

	// Items are the navigation links (overrides top-level nav if set)
	Items []NavItem `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
}

NavComponentConfig configures the navigation component.

type NavItem struct {
	// Label is the display text for the nav link
	Label string `json:"label" yaml:"label" toml:"label"`

	// URL is the link destination (can be relative or absolute)
	URL string `json:"url" yaml:"url" toml:"url"`

	// External indicates if the link opens in a new tab (default: false)
	External bool `json:"external,omitempty" yaml:"external,omitempty" toml:"external,omitempty"`
}

NavItem represents a navigation link.

type OneLineLinkConfig added in v0.2.0

type OneLineLinkConfig struct {
	// Enabled controls whether link expansion is active (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// CardClass is the CSS class for the link card (default: "link-card")
	CardClass string `json:"card_class" yaml:"card_class" toml:"card_class"`

	// FetchMetadata enables fetching title/description from URLs (default: false for performance)
	FetchMetadata bool `json:"fetch_metadata" yaml:"fetch_metadata" toml:"fetch_metadata"`

	// FallbackTitle is used when metadata fetch fails (default: "Link")
	FallbackTitle string `json:"fallback_title" yaml:"fallback_title" toml:"fallback_title"`

	// Timeout is the HTTP request timeout in seconds (default: 5)
	Timeout int `json:"timeout" yaml:"timeout" toml:"timeout"`

	// ExcludePatterns is a list of regex patterns for URLs to exclude from expansion
	ExcludePatterns []string `json:"exclude_patterns" yaml:"exclude_patterns" toml:"exclude_patterns"`
}

OneLineLinkConfig configures the one_line_link plugin.

func NewOneLineLinkConfig added in v0.2.0

func NewOneLineLinkConfig() OneLineLinkConfig

NewOneLineLinkConfig creates a new OneLineLinkConfig with default values.

type OpenGraphTag added in v0.3.0

type OpenGraphTag struct {
	// Property is the og: property name (e.g., "og:title")
	Property string `json:"property" yaml:"property" toml:"property"`

	// Content is the tag content value
	Content string `json:"content" yaml:"content" toml:"content"`
}

OpenGraphTag represents an OpenGraph meta tag.

type PagefindConfig added in v0.3.0

type PagefindConfig struct {
	// BundleDir is the output directory for search index (default: "_pagefind")
	BundleDir string `json:"bundle_dir,omitempty" yaml:"bundle_dir,omitempty" toml:"bundle_dir,omitempty"`

	// ExcludeSelectors are CSS selectors for elements to exclude from indexing
	ExcludeSelectors []string `json:"exclude_selectors,omitempty" yaml:"exclude_selectors,omitempty" toml:"exclude_selectors,omitempty"`

	// RootSelector is the CSS selector for the searchable content container
	RootSelector string `json:"root_selector,omitempty" yaml:"root_selector,omitempty" toml:"root_selector,omitempty"`

	// AutoInstall enables automatic Pagefind binary 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 Pagefind binaries (default: XDG cache)
	CacheDir string `json:"cache_dir,omitempty" yaml:"cache_dir,omitempty" toml:"cache_dir,omitempty"`
}

PagefindConfig configures Pagefind CLI behavior.

func (*PagefindConfig) IsAutoInstallEnabled added in v0.3.0

func (p *PagefindConfig) IsAutoInstallEnabled() bool

IsAutoInstallEnabled returns whether automatic Pagefind installation is enabled. Defaults to true if not explicitly set.

type PaginationType added in v0.3.0

type PaginationType string

PaginationType represents the type of pagination to use.

const (
	// PaginationManual uses traditional page links with full page reloads.
	PaginationManual PaginationType = "manual"

	// PaginationHTMX uses HTMX for seamless AJAX-based page loading.
	PaginationHTMX PaginationType = "htmx"

	// PaginationJS uses client-side JavaScript for pagination.
	PaginationJS PaginationType = "js"
)

type PluginNotFoundError

type PluginNotFoundError struct {
	Name      string
	Available []string
}

PluginNotFoundError indicates a plugin was not found.

func NewPluginNotFoundError

func NewPluginNotFoundError(name string, available []string) *PluginNotFoundError

NewPluginNotFoundError creates a new PluginNotFoundError.

func (*PluginNotFoundError) Error

func (e *PluginNotFoundError) Error() string

type Post

type Post struct {
	// Path is the source file path
	Path string `json:"path" yaml:"path" toml:"path"`

	// Content is the raw markdown content after frontmatter
	Content string `json:"content" yaml:"content" toml:"content"`

	// Slug is the URL-safe identifier
	Slug string `json:"slug" yaml:"slug" toml:"slug"`

	// Href is the relative URL path (e.g., /my-post/)
	Href string `json:"href" yaml:"href" toml:"href"`

	// Title is the optional post title
	Title *string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`

	// Date is the optional publication date
	Date *time.Time `json:"date,omitempty" yaml:"date,omitempty" toml:"date,omitempty"`

	// Published indicates if the post is published
	Published bool `json:"published" yaml:"published" toml:"published"`

	// Draft indicates if the post is a draft
	Draft bool `json:"draft" yaml:"draft" toml:"draft"`

	// Skip indicates if the post should be skipped during processing
	Skip bool `json:"skip" yaml:"skip" toml:"skip"`

	// Tags is a list of tags associated with the post
	Tags []string `json:"tags,omitempty" yaml:"tags,omitempty" toml:"tags,omitempty"`

	// Description is the optional post description
	Description *string `json:"description,omitempty" yaml:"description,omitempty" toml:"description,omitempty"`

	// Template is the template file to use for rendering (default: "post.html")
	Template string `json:"template" yaml:"template" toml:"template"`

	// HTML is the final rendered HTML including template wrapper
	HTML string `json:"html" yaml:"html" toml:"html"`

	// ArticleHTML is the rendered content without template wrapper
	ArticleHTML string `json:"article_html" yaml:"article_html" toml:"article_html"`

	// Prev is the previous post in the navigation sequence
	Prev *Post `json:"-" yaml:"-" toml:"-"`

	// Next is the next post in the navigation sequence
	Next *Post `json:"-" yaml:"-" toml:"-"`

	// PrevNextFeed is the feed/series slug used for navigation
	PrevNextFeed string `json:"prevnext_feed,omitempty" yaml:"prevnext_feed,omitempty" toml:"prevnext_feed,omitempty"`

	// PrevNextContext contains full navigation context
	PrevNextContext *PrevNextContext `json:"-" yaml:"-" toml:"-"`

	// Hrefs is a list of raw href values from all links in the post
	Hrefs []string `json:"hrefs,omitempty" yaml:"hrefs,omitempty" toml:"hrefs,omitempty"`

	// Inlinks are links pointing TO this post from other posts
	Inlinks []*Link `json:"inlinks,omitempty" yaml:"inlinks,omitempty" toml:"inlinks,omitempty"`

	// Outlinks are links FROM this post to other pages
	Outlinks []*Link `json:"outlinks,omitempty" yaml:"outlinks,omitempty" toml:"outlinks,omitempty"`

	// Extra holds dynamic/unknown fields from frontmatter
	Extra map[string]interface{} `json:"extra,omitempty" yaml:"extra,omitempty" toml:"extra,omitempty"`
}

Post represents a single markdown post with its metadata and content.

func NewPost

func NewPost(path string) *Post

NewPost creates a new Post with the given source file path and default values.

func (*Post) GenerateHref

func (p *Post) GenerateHref()

GenerateHref generates the relative URL path from the slug. The href follows the pattern /{slug}/ or / for empty slug (homepage). Note: This method assumes the slug is already set. Use GenerateSlug() first if automatic slug generation is needed.

func (*Post) GenerateSlug

func (p *Post) GenerateSlug()

GenerateSlug generates a URL-safe slug from the title or path. If a title is set, it uses the title; otherwise, it derives the slug from the file path.

Special handling for index.md files:

  • ./index.md → "" (empty slug, becomes homepage)
  • docs/index.md → "docs"
  • blog/guides/index.md → "blog/guides"

func (*Post) Get

func (p *Post) Get(key string) interface{}

Get retrieves a value from the Extra map by key. Returns nil if the key does not exist.

func (*Post) Has

func (p *Post) Has(key string) bool

Has checks if a key exists in the Extra map.

func (*Post) Set

func (p *Post) Set(key string, value interface{})

Set sets a value in the Extra map. Initializes the Extra map if it is nil.

type PostFormatsConfig added in v0.3.0

type PostFormatsConfig struct {
	// HTML enables standard HTML output (default: true)
	// Generates: /slug/index.html
	HTML *bool `json:"html,omitempty" yaml:"html,omitempty" toml:"html,omitempty"`

	// Markdown enables raw markdown output (default: false)
	// Generates: /slug/index.md (source with frontmatter)
	Markdown bool `json:"markdown" yaml:"markdown" toml:"markdown"`

	// Text enables plain text output (default: false)
	// Generates: /slug/index.txt (content only, no formatting)
	Text bool `json:"text" yaml:"text" toml:"text"`

	// OG enables OpenGraph card HTML output for social image generation (default: false)
	// Generates: /slug/og/index.html (1200x630 optimized for screenshots)
	OG bool `json:"og" yaml:"og" toml:"og"`
}

PostFormatsConfig configures the output formats for individual posts. This controls what file formats are generated for each post.

func NewPostFormatsConfig added in v0.3.0

func NewPostFormatsConfig() PostFormatsConfig

NewPostFormatsConfig creates a new PostFormatsConfig with default values. By default, only HTML output is enabled.

func (*PostFormatsConfig) IsHTMLEnabled added in v0.3.0

func (p *PostFormatsConfig) IsHTMLEnabled() bool

IsHTMLEnabled returns whether HTML output is enabled. Defaults to true if not explicitly set.

type PostProcessingError

type PostProcessingError struct {
	Path    string
	Stage   string
	Message string
	Err     error
}

PostProcessingError indicates an error during post processing.

func NewPostProcessingError

func NewPostProcessingError(path, stage, message string, err error) *PostProcessingError

NewPostProcessingError creates a new PostProcessingError.

func (*PostProcessingError) Error

func (e *PostProcessingError) Error() string

func (*PostProcessingError) Unwrap

func (e *PostProcessingError) Unwrap() error

type PrevNextConfig

type PrevNextConfig struct {
	// Enabled controls whether the plugin is active (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// Strategy determines how prev/next links are resolved
	Strategy PrevNextStrategy `json:"strategy" yaml:"strategy" toml:"strategy"`

	// DefaultFeed is the feed slug to use when strategy is "explicit_feed"
	DefaultFeed string `json:"default_feed" yaml:"default_feed" toml:"default_feed"`
}

PrevNextConfig holds configuration for the prevnext plugin.

func NewPrevNextConfig

func NewPrevNextConfig() PrevNextConfig

NewPrevNextConfig creates a new PrevNextConfig with default values.

func (*PrevNextConfig) ApplyDefaults

func (c *PrevNextConfig) ApplyDefaults()

ApplyDefaults ensures all required fields have sensible defaults.

type PrevNextContext

type PrevNextContext struct {
	// FeedSlug is the feed or series slug used for navigation
	FeedSlug string `json:"feed_slug" yaml:"feed_slug" toml:"feed_slug"`

	// FeedTitle is the feed or series title
	FeedTitle string `json:"feed_title" yaml:"feed_title" toml:"feed_title"`

	// Position is the 1-indexed position of the post in the sequence
	Position int `json:"position" yaml:"position" toml:"position"`

	// Total is the total number of posts in the sequence
	Total int `json:"total" yaml:"total" toml:"total"`

	// Prev is the previous post in the sequence (nil if first)
	Prev *Post `json:"prev,omitempty" yaml:"prev,omitempty" toml:"prev,omitempty"`

	// Next is the next post in the sequence (nil if last)
	Next *Post `json:"next,omitempty" yaml:"next,omitempty" toml:"next,omitempty"`
}

PrevNextContext contains navigation context for a post.

func (*PrevNextContext) HasNext

func (c *PrevNextContext) HasNext() bool

HasNext returns true if there is a next post.

func (*PrevNextContext) HasPrev

func (c *PrevNextContext) HasPrev() bool

HasPrev returns true if there is a previous post.

func (*PrevNextContext) IsFirst

func (c *PrevNextContext) IsFirst() bool

IsFirst returns true if this is the first post in the sequence.

func (*PrevNextContext) IsLast

func (c *PrevNextContext) IsLast() bool

IsLast returns true if this is the last post in the sequence.

type PrevNextStrategy

type PrevNextStrategy string

PrevNextStrategy defines how prev/next links are calculated.

const (
	// StrategyFirstFeed uses the first feed the post appears in.
	StrategyFirstFeed PrevNextStrategy = "first_feed"

	// StrategyExplicitFeed always uses the configured default_feed.
	StrategyExplicitFeed PrevNextStrategy = "explicit_feed"

	// StrategySeries uses the post's series frontmatter, falling back to first_feed.
	StrategySeries PrevNextStrategy = "series"

	// StrategyFrontmatter uses the post's prevnext_feed frontmatter, falling back to first_feed.
	StrategyFrontmatter PrevNextStrategy = "frontmatter"
)

func (PrevNextStrategy) IsValid

func (s PrevNextStrategy) IsValid() bool

IsValid returns true if the strategy is a recognized value.

type QRCodeConfig added in v0.2.0

type QRCodeConfig struct {
	// Enabled controls whether QR codes are generated (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// Format is the output format: "svg" or "png" (default: "svg")
	Format string `json:"format" yaml:"format" toml:"format"`

	// Size is the QR code size in pixels (default: 200)
	Size int `json:"size" yaml:"size" toml:"size"`

	// OutputDir is the subdirectory in output for QR code files (default: "qrcodes")
	OutputDir string `json:"output_dir" yaml:"output_dir" toml:"output_dir"`

	// ErrorCorrection is the QR error correction level: L, M, Q, H (default: "M")
	ErrorCorrection string `json:"error_correction" yaml:"error_correction" toml:"error_correction"`

	// Foreground is the QR code foreground color in hex (default: "#000000")
	Foreground string `json:"foreground" yaml:"foreground" toml:"foreground"`

	// Background is the QR code background color in hex (default: "#ffffff")
	Background string `json:"background" yaml:"background" toml:"background"`
}

QRCodeConfig configures the qrcode plugin.

func NewQRCodeConfig added in v0.2.0

func NewQRCodeConfig() QRCodeConfig

NewQRCodeConfig creates a new QRCodeConfig with default values.

type SEOConfig added in v0.3.0

type SEOConfig struct {
	// TwitterHandle is the Twitter/X username (without @) for twitter:site meta tag
	TwitterHandle string `json:"twitter_handle" yaml:"twitter_handle" toml:"twitter_handle"`

	// DefaultImage is the default Open Graph image URL for pages without a specific image
	DefaultImage string `json:"default_image" yaml:"default_image" toml:"default_image"`

	// LogoURL is the site logo URL for Schema.org structured data
	LogoURL string `json:"logo_url" yaml:"logo_url" toml:"logo_url"`

	// StructuredData configures JSON-LD Schema.org generation
	StructuredData StructuredDataConfig `json:"structured_data" yaml:"structured_data" toml:"structured_data"`
}

SEOConfig configures SEO metadata for the site.

func NewSEOConfig added in v0.3.0

func NewSEOConfig() SEOConfig

NewSEOConfig creates a new SEOConfig with default values.

type SchemaAgent added in v0.3.0

type SchemaAgent struct {
	Type string       `json:"@type"`
	Name string       `json:"name"`
	URL  string       `json:"url,omitempty"`
}

SchemaAgent represents a Schema.org Person or Organization.

func NewSchemaAgent added in v0.3.0

func NewSchemaAgent(agentType, name string) *SchemaAgent

NewSchemaAgent creates a new SchemaAgent (Person or Organization).

func (a *SchemaAgent) WithLogo(logoURL string) *SchemaAgent

WithLogo sets the logo on a SchemaAgent and returns it for chaining.

func (*SchemaAgent) WithURL added in v0.3.0

func (a *SchemaAgent) WithURL(url string) *SchemaAgent

WithURL sets the URL on a SchemaAgent and returns it for chaining.

type ScriptTag added in v0.3.0

type ScriptTag struct {
	Src string `json:"src" yaml:"src" toml:"src"`
}

ScriptTag represents a <script> tag configuration.

type SearchConfig added in v0.3.0

type SearchConfig struct {
	// Enabled controls whether search is active (default: true)
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`

	// Position controls where search UI appears: "navbar", "sidebar", "footer", "custom"
	Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`

	// Placeholder is the search input placeholder text
	Placeholder string `json:"placeholder,omitempty" yaml:"placeholder,omitempty" toml:"placeholder,omitempty"`

	// ShowImages shows thumbnails in search results
	ShowImages *bool `json:"show_images,omitempty" yaml:"show_images,omitempty" toml:"show_images,omitempty"`

	// ExcerptLength is the character limit for result excerpts
	ExcerptLength int `json:"excerpt_length,omitempty" yaml:"excerpt_length,omitempty" toml:"excerpt_length,omitempty"`

	// Pagefind configures the Pagefind CLI options
	Pagefind PagefindConfig `json:"pagefind,omitempty" yaml:"pagefind,omitempty" toml:"pagefind,omitempty"`

	// Feeds configures feed-specific search instances
	Feeds []SearchFeedConfig `json:"feeds,omitempty" yaml:"feeds,omitempty" toml:"feeds,omitempty"`
}

SearchConfig configures site-wide search functionality using Pagefind.

func NewSearchConfig added in v0.3.0

func NewSearchConfig() SearchConfig

NewSearchConfig creates a new SearchConfig with default values.

func (*SearchConfig) IsEnabled added in v0.3.0

func (s *SearchConfig) IsEnabled() bool

IsEnabled returns whether search is enabled. Defaults to true if not explicitly set.

func (*SearchConfig) IsShowImages added in v0.3.0

func (s *SearchConfig) IsShowImages() bool

IsShowImages returns whether to show images in search results. Defaults to true if not explicitly set.

type SearchFeedConfig added in v0.3.0

type SearchFeedConfig struct {
	// Name is the search instance identifier
	Name string `json:"name" yaml:"name" toml:"name"`

	// Filter is the filter expression for posts in this search
	Filter string `json:"filter" yaml:"filter" toml:"filter"`

	// Position controls where this search UI appears
	Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`

	// Placeholder is the search input placeholder text
	Placeholder string `json:"placeholder,omitempty" yaml:"placeholder,omitempty" toml:"placeholder,omitempty"`
}

SearchFeedConfig configures a feed-specific search instance.

type StructuredData added in v0.3.0

type StructuredData struct {
	// JSONLD is the JSON-LD script content (without script tags)
	JSONLD string `json:"jsonld" yaml:"jsonld" toml:"jsonld"`

	// OpenGraph contains OpenGraph meta tags
	OpenGraph []OpenGraphTag `json:"opengraph" yaml:"opengraph" toml:"opengraph"`

	// Twitter contains Twitter Card meta tags
	Twitter []TwitterTag `json:"twitter" yaml:"twitter" toml:"twitter"`
}

StructuredData holds generated structured data for a post. This is stored in post.Extra["structured_data"] after processing.

func NewStructuredData added in v0.3.0

func NewStructuredData() *StructuredData

NewStructuredData creates a new empty StructuredData.

func (*StructuredData) AddOpenGraph added in v0.3.0

func (s *StructuredData) AddOpenGraph(property, content string)

AddOpenGraph adds an OpenGraph tag.

func (*StructuredData) AddTwitter added in v0.3.0

func (s *StructuredData) AddTwitter(name, content string)

AddTwitter adds a Twitter Card tag.

type StructuredDataConfig added in v0.3.0

type StructuredDataConfig struct {
	// Enabled controls whether structured data is generated (default: true)
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`

	// Publisher is the site publisher information for Schema.org
	Publisher *EntityConfig `json:"publisher,omitempty" yaml:"publisher,omitempty" toml:"publisher,omitempty"`

	// DefaultAuthor is the default author for posts without explicit author
	DefaultAuthor *EntityConfig `json:"default_author,omitempty" yaml:"default_author,omitempty" toml:"default_author,omitempty"`
}

StructuredDataConfig configures JSON-LD Schema.org structured data generation.

func NewStructuredDataConfig added in v0.3.0

func NewStructuredDataConfig() StructuredDataConfig

NewStructuredDataConfig creates a new StructuredDataConfig with default values.

func (*StructuredDataConfig) IsEnabled added in v0.3.0

func (s *StructuredDataConfig) IsEnabled() bool

IsEnabled returns whether structured data generation is enabled. Defaults to true if not explicitly set.

type SyndicationConfig

type SyndicationConfig struct {
	// MaxItems is the maximum number of items in syndication feeds
	MaxItems int `json:"max_items" yaml:"max_items" toml:"max_items"`

	// IncludeContent determines if full content is included in feeds
	IncludeContent bool `json:"include_content" yaml:"include_content" toml:"include_content"`
}

SyndicationConfig configures syndication feed behavior.

type TemplateNotFoundError

type TemplateNotFoundError struct {
	Name       string
	SearchPath string
}

TemplateNotFoundError indicates a template file was not found.

func NewTemplateNotFoundError

func NewTemplateNotFoundError(name, searchPath string) *TemplateNotFoundError

NewTemplateNotFoundError creates a new TemplateNotFoundError.

func (*TemplateNotFoundError) Error

func (e *TemplateNotFoundError) Error() string

type TemplateSyntaxError

type TemplateSyntaxError struct {
	Name    string
	Line    int
	Column  int
	Message string
	Err     error
}

TemplateSyntaxError indicates a syntax error in a template.

func NewTemplateSyntaxError

func NewTemplateSyntaxError(name, message string, err error) *TemplateSyntaxError

NewTemplateSyntaxError creates a new TemplateSyntaxError.

func (*TemplateSyntaxError) Error

func (e *TemplateSyntaxError) Error() string

func (*TemplateSyntaxError) Unwrap

func (e *TemplateSyntaxError) Unwrap() error

type ThemeConfig

type ThemeConfig struct {
	// Name is the theme name (default: "default")
	Name string `json:"name" yaml:"name" toml:"name"`

	// Palette is the color palette to use (default: "default-light")
	Palette string `json:"palette" yaml:"palette" toml:"palette"`

	// Variables allows overriding specific CSS variables
	Variables map[string]string `json:"variables" yaml:"variables" toml:"variables"`

	// CustomCSS is a path to a custom CSS file to include
	CustomCSS string `json:"custom_css" yaml:"custom_css" toml:"custom_css"`
}

ThemeConfig configures the site theme.

func NewThemeConfig

func NewThemeConfig() ThemeConfig

NewThemeConfig creates a new ThemeConfig with default values.

type TwitterTag added in v0.3.0

type TwitterTag struct {
	// Name is the twitter: name (e.g., "twitter:card")
	Name string `json:"name" yaml:"name" toml:"name"`

	// Content is the tag content value
	Content string `json:"content" yaml:"content" toml:"content"`
}

TwitterTag represents a Twitter Card meta tag.

type WebPage added in v0.3.0

type WebPage struct {
	Type string `json:"@type"`
	ID   string `json:"@id"`
}

WebPage represents a Schema.org WebPage for JSON-LD.

type WebSite added in v0.3.0

type WebSite struct {
	Context     string       `json:"@context"`
	Type        string       `json:"@type"`
	Name        string       `json:"name"`
	Description string       `json:"description,omitempty"`
	URL         string       `json:"url"`
	Publisher   *SchemaAgent `json:"publisher,omitempty"`
}

WebSite represents a Schema.org WebSite for JSON-LD.

func NewWebSite added in v0.3.0

func NewWebSite(name, url string) *WebSite

NewWebSite creates a new WebSite with required fields.

type WebmentionConfig added in v0.3.0

type WebmentionConfig struct {
	// Enabled controls whether Webmention link tag is included (default: false)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// Endpoint is the URL of your Webmention endpoint
	// Example: "https://webmention.io/example.com/webmention"
	Endpoint string `json:"endpoint" yaml:"endpoint" toml:"endpoint"`
}

WebmentionConfig configures Webmention endpoint for receiving mentions. Webmention is a simple protocol for notifying URLs when you link to them. See https://www.w3.org/TR/webmention/ for the specification.

func NewWebmentionConfig added in v0.3.0

func NewWebmentionConfig() WebmentionConfig

NewWebmentionConfig creates a new WebmentionConfig with default values.

type WikilinkHoverConfig added in v0.2.0

type WikilinkHoverConfig struct {
	// Enabled controls whether hover previews are added (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// PreviewLength is the maximum characters for the preview text (default: 200)
	PreviewLength int `json:"preview_length" yaml:"preview_length" toml:"preview_length"`

	// IncludeImage adds data-preview-image attribute if post has a featured image (default: true)
	IncludeImage bool `json:"include_image" yaml:"include_image" toml:"include_image"`

	// ScreenshotService is an optional URL prefix for screenshot generation
	// If set, adds data-preview-screenshot attribute with the URL
	ScreenshotService string `json:"screenshot_service" yaml:"screenshot_service" toml:"screenshot_service"`
}

WikilinkHoverConfig configures the wikilink_hover plugin.

func NewWikilinkHoverConfig added in v0.2.0

func NewWikilinkHoverConfig() WikilinkHoverConfig

NewWikilinkHoverConfig creates a new WikilinkHoverConfig with default values.

type YouTubeConfig added in v0.3.0

type YouTubeConfig struct {
	// Enabled controls whether YouTube URL conversion is active (default: true)
	Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`

	// PrivacyEnhanced uses youtube-nocookie.com for enhanced privacy (default: true)
	PrivacyEnhanced bool `json:"privacy_enhanced" yaml:"privacy_enhanced" toml:"privacy_enhanced"`

	// ContainerClass is the CSS class for the embed container (default: "youtube-embed")
	ContainerClass string `json:"container_class" yaml:"container_class" toml:"container_class"`

	// LazyLoad enables lazy loading of iframe (default: true)
	LazyLoad bool `json:"lazy_load" yaml:"lazy_load" toml:"lazy_load"`
}

YouTubeConfig configures the youtube plugin.

func NewYouTubeConfig added in v0.3.0

func NewYouTubeConfig() YouTubeConfig

NewYouTubeConfig creates a new YouTubeConfig with default values.

Jump to

Keyboard shortcuts

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