Documentation
¶
Index ¶
- func LayoutToTemplate(layout string) string
- type AlternateFeed
- type BareLayoutConfig
- type BlogLayoutConfig
- type BlogPosting
- type BlogrollCategory
- type BlogrollConfig
- type BlogrollTemplates
- type BridgeFiltersConfig
- type BridgesConfig
- type CSVFenceConfig
- type ChartJSConfig
- type ComponentsConfig
- type Config
- type ConfigValidationError
- type ContentTemplateConfig
- type ContentTemplatesConfig
- type DocSidebarConfig
- type DocsLayoutConfig
- type EmbedsConfig
- type EntityConfig
- type ExternalEntry
- type ExternalFeed
- type ExternalFeedConfig
- type FeedConfig
- type FeedDefaults
- type FeedFormats
- type FeedPage
- type FeedSidebarConfig
- type FeedTemplates
- type FeedType
- type FilterExpressionError
- type FooterComponentConfig
- type FooterConfig
- type FooterLayoutConfig
- type FrontmatterParseError
- type GlobConfig
- type HeadConfig
- type HeaderLayoutConfig
- type HighlightConfig
- type ImageObject
- type IndieAuthConfig
- type LandingLayoutConfig
- type LayoutConfig
- type LayoutDefaults
- type Link
- type LinkTag
- type MDVideoConfig
- type MarkdownConfig
- type MermaidConfig
- type MetaTag
- type MultiFeedSection
- type NavComponentConfig
- type NavItem
- type OneLineLinkConfig
- type OpenGraphTag
- type PagefindConfig
- type PaginationType
- type PathSidebarConfig
- type PluginNotFoundError
- type Post
- type PostFormatsConfig
- type PostProcessingError
- type PrevNextConfig
- type PrevNextContext
- type PrevNextStrategy
- type QRCodeConfig
- type ReaderPage
- type SEOConfig
- type SchemaAgent
- type ScriptTag
- type SearchConfig
- type SearchFeedConfig
- type SidebarAutoGenerate
- type SidebarConfig
- func (s *SidebarConfig) GetEffectiveConfig(path string) *SidebarConfig
- func (s *SidebarConfig) IsCollapsible() bool
- func (s *SidebarConfig) IsDefaultOpen() bool
- func (s *SidebarConfig) IsEnabled() bool
- func (s *SidebarConfig) IsMultiFeed() bool
- func (s *SidebarConfig) ResolveForPath(path string) (*PathSidebarConfig, bool)
- type SidebarNavItem
- type StructuredData
- type StructuredDataConfig
- type SyndicationConfig
- type TemplateNotFoundError
- type TemplateSyntaxError
- type ThemeConfig
- type TocConfig
- type TwitterTag
- type WebMentionsConfig
- type WebPage
- type WebSite
- type WebmentionConfig
- type WikilinkHoverConfig
- type YouTubeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LayoutToTemplate ¶ added in v0.4.0
LayoutToTemplate converts a layout name to a template file path. Layout names map to templates as follows:
- "docs" -> "layouts/docs.html"
- "blog" -> "post.html"
- "landing" -> "layouts/landing.html"
- "bare" -> "layouts/bare.html"
- "" (empty) -> "post.html" (default)
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 BareLayoutConfig ¶ added in v0.4.0
type BareLayoutConfig struct {
// ContentMaxWidth is the maximum width of the content area (default: "100%")
ContentMaxWidth string `json:"content_max_width,omitempty" yaml:"content_max_width,omitempty" toml:"content_max_width,omitempty"`
}
BareLayoutConfig configures the bare layout. This is a minimal layout with no chrome - just the content.
type BlogLayoutConfig ¶ added in v0.4.0
type BlogLayoutConfig struct {
// ContentMaxWidth is the maximum width of the content area (default: "720px")
ContentMaxWidth string `json:"content_max_width,omitempty" yaml:"content_max_width,omitempty" toml:"content_max_width,omitempty"`
// ShowToc enables table of contents for blog posts (default: false)
ShowToc *bool `json:"show_toc,omitempty" yaml:"show_toc,omitempty" toml:"show_toc,omitempty"`
// TocPosition controls TOC placement: "left" or "right" (default: "right")
TocPosition string `json:"toc_position,omitempty" yaml:"toc_position,omitempty" toml:"toc_position,omitempty"`
// TocWidth is the width of the table of contents (default: "200px")
TocWidth string `json:"toc_width,omitempty" yaml:"toc_width,omitempty" toml:"toc_width,omitempty"`
// HeaderStyle controls the header appearance: "full", "minimal", "transparent", "none" (default: "full")
HeaderStyle string `json:"header_style,omitempty" yaml:"header_style,omitempty" toml:"header_style,omitempty"`
FooterStyle string `json:"footer_style,omitempty" yaml:"footer_style,omitempty" toml:"footer_style,omitempty"`
// ShowAuthor displays the post author (default: true)
ShowAuthor *bool `json:"show_author,omitempty" yaml:"show_author,omitempty" toml:"show_author,omitempty"`
// ShowDate displays the post date (default: true)
ShowDate *bool `json:"show_date,omitempty" yaml:"show_date,omitempty" toml:"show_date,omitempty"`
// ShowTags displays the post tags (default: true)
ShowTags *bool `json:"show_tags,omitempty" yaml:"show_tags,omitempty" toml:"show_tags,omitempty"`
// ShowReadingTime displays estimated reading time (default: true)
ShowReadingTime *bool `json:"show_reading_time,omitempty" yaml:"show_reading_time,omitempty" toml:"show_reading_time,omitempty"`
// ShowPrevNext displays previous/next post navigation (default: true)
ShowPrevNext *bool `json:"show_prev_next,omitempty" yaml:"show_prev_next,omitempty" toml:"show_prev_next,omitempty"`
}
BlogLayoutConfig configures the blog layout. This is a single-column layout optimized for reading long-form content.
func (*BlogLayoutConfig) IsShowAuthor ¶ added in v0.4.0
func (b *BlogLayoutConfig) IsShowAuthor() bool
IsShowAuthor returns whether to show the author.
func (*BlogLayoutConfig) IsShowDate ¶ added in v0.4.0
func (b *BlogLayoutConfig) IsShowDate() bool
IsShowDate returns whether to show the date.
func (*BlogLayoutConfig) IsShowPrevNext ¶ added in v0.4.0
func (b *BlogLayoutConfig) IsShowPrevNext() bool
IsShowPrevNext returns whether to show previous/next navigation.
func (*BlogLayoutConfig) IsShowReadingTime ¶ added in v0.4.0
func (b *BlogLayoutConfig) IsShowReadingTime() bool
IsShowReadingTime returns whether to show reading time.
func (*BlogLayoutConfig) IsShowTags ¶ added in v0.4.0
func (b *BlogLayoutConfig) IsShowTags() bool
IsShowTags returns whether to show tags.
func (*BlogLayoutConfig) IsShowToc ¶ added in v0.4.0
func (b *BlogLayoutConfig) IsShowToc() bool
IsShowToc returns whether to show the table of contents.
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 BlogrollCategory ¶ added in v0.5.0
type BlogrollCategory struct {
// Name is the category name
Name string `json:"name"`
// Slug is the URL-safe category identifier
Slug string `json:"slug"`
// Feeds are the feeds in this category
Feeds []*ExternalFeed `json:"feeds"`
}
BlogrollCategory groups feeds by category for display.
type BlogrollConfig ¶ added in v0.5.0
type BlogrollConfig struct {
// Enabled controls whether blogroll functionality is active (default: false)
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
// BlogrollSlug is the URL path for the blogroll page (default: "blogroll")
// This generates the page at /{blogroll_slug}/index.html
BlogrollSlug string `json:"blogroll_slug" yaml:"blogroll_slug" toml:"blogroll_slug"`
// ReaderSlug is the URL path for the reader page (default: "reader")
// This generates the page at /{reader_slug}/index.html
ReaderSlug string `json:"reader_slug" yaml:"reader_slug" toml:"reader_slug"`
// CacheDir is the directory for caching fetched feeds (default: "cache/blogroll")
CacheDir string `json:"cache_dir" yaml:"cache_dir" toml:"cache_dir"`
// CacheDuration is how long to cache fetched feeds (default: "1h")
CacheDuration string `json:"cache_duration" yaml:"cache_duration" toml:"cache_duration"`
// Timeout is the HTTP request timeout in seconds (default: 30)
Timeout int `json:"timeout" yaml:"timeout" toml:"timeout"`
// ConcurrentRequests is the max concurrent feed fetches (default: 5)
ConcurrentRequests int `json:"concurrent_requests" yaml:"concurrent_requests" toml:"concurrent_requests"`
// MaxEntriesPerFeed limits entries fetched per feed (default: 50)
MaxEntriesPerFeed int `json:"max_entries_per_feed" yaml:"max_entries_per_feed" toml:"max_entries_per_feed"`
// ItemsPerPage is the number of entries per page on the reader page (default: 50)
ItemsPerPage int `json:"items_per_page" yaml:"items_per_page" toml:"items_per_page"`
// OrphanThreshold is the minimum entries 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"`
// FallbackImageService is an optional URL template for generating fallback images
// for entries without images. Use {url} as placeholder for the entry URL.
// Example: "https://shots.example.com/shot/?url={url}&width=1200"
// If empty, no fallback images are generated (default: "")
FallbackImageService string `json:"fallback_image_service" yaml:"fallback_image_service" toml:"fallback_image_service"`
// Feeds is the list of RSS/Atom feeds to fetch
Feeds []ExternalFeedConfig `json:"feeds" yaml:"feeds" toml:"feeds"`
// Templates configures custom templates for blogroll pages
Templates BlogrollTemplates `json:"templates" yaml:"templates" toml:"templates"`
}
BlogrollConfig configures the blogroll and RSS reader functionality.
func NewBlogrollConfig ¶ added in v0.5.0
func NewBlogrollConfig() BlogrollConfig
NewBlogrollConfig creates a new BlogrollConfig with default values.
type BlogrollTemplates ¶ added in v0.5.0
type BlogrollTemplates struct {
// Blogroll is the template for the /blogroll page
Blogroll string `json:"blogroll" yaml:"blogroll" toml:"blogroll"`
// Reader is the template for the /reader page
Reader string `json:"reader" yaml:"reader" toml:"reader"`
}
BlogrollTemplates specifies custom templates for blogroll pages.
type BridgeFiltersConfig ¶ added in v0.5.0
type BridgeFiltersConfig struct {
// Platforms limits which platforms to accept (empty = all enabled)
Platforms []string `json:"platforms" yaml:"platforms" toml:"platforms"`
// InteractionTypes limits which interaction types to accept (empty = all)
// Valid values: "like", "repost", "reply", "bookmark", "mention"
InteractionTypes []string `json:"interaction_types" yaml:"interaction_types" toml:"interaction_types"`
// MinContentLength filters out mentions with content shorter than this
MinContentLength int `json:"min_content_length" yaml:"min_content_length" toml:"min_content_length"`
// BlockedDomains is a list of domains to reject mentions from
BlockedDomains []string `json:"blocked_domains" yaml:"blocked_domains" toml:"blocked_domains"`
}
BridgeFiltersConfig configures filtering for bridged webmentions.
type BridgesConfig ¶ added in v0.5.0
type BridgesConfig struct {
// Enabled controls whether bridging detection is active (default: false)
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
// BridgyFediverse enables Bridgy Fed integration (default: true when bridges enabled)
BridgyFediverse bool `json:"bridgy_fediverse" yaml:"bridgy_fediverse" toml:"bridgy_fediverse"`
// Platform-specific controls
Bluesky bool `json:"bluesky" yaml:"bluesky" toml:"bluesky"`
Twitter bool `json:"twitter" yaml:"twitter" toml:"twitter"`
Mastodon bool `json:"mastodon" yaml:"mastodon" toml:"mastodon"`
GitHub bool `json:"github" yaml:"github" toml:"github"`
Flickr bool `json:"flickr" yaml:"flickr" toml:"flickr"`
// Filters configures filtering of bridged mentions
Filters BridgeFiltersConfig `json:"filters" yaml:"filters" toml:"filters"`
}
BridgesConfig configures social media bridging services.
func NewBridgesConfig ¶ added in v0.5.0
func NewBridgesConfig() BridgesConfig
NewBridgesConfig creates a new BridgesConfig with default values.
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 NavComponentConfig `json:"nav" yaml:"nav" toml:"nav"`
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 []NavItem `json:"nav" yaml:"nav" toml:"nav"`
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"`
// Layout configures the layout system for page structure
Layout LayoutConfig `json:"layout" yaml:"layout" toml:"layout"`
// Sidebar configures the sidebar navigation component
Sidebar SidebarConfig `json:"sidebar" yaml:"sidebar" toml:"sidebar"`
// Toc configures the table of contents component
Toc TocConfig `json:"toc" yaml:"toc" toml:"toc"`
// Header configures the header component for layouts
Header HeaderLayoutConfig `json:"header" yaml:"header" toml:"header"`
FooterLayout FooterLayoutConfig `json:"footer_layout" yaml:"footer_layout" toml:"footer_layout"`
// ContentTemplates configures the content template system for the new command
ContentTemplates ContentTemplatesConfig `json:"content_templates" yaml:"content_templates" toml:"content_templates"`
// Blogroll configures the blogroll and RSS reader functionality
Blogroll BlogrollConfig `json:"blogroll" yaml:"blogroll" toml:"blogroll"`
}
Config represents the site configuration for markata-go.
func (*Config) IsHookEnabled ¶
IsHookEnabled checks if a hook is enabled (in Hooks and not in DisabledHooks).
type ConfigValidationError ¶
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 ContentTemplateConfig ¶ added in v0.5.0
type ContentTemplateConfig struct {
// Name is the template identifier (e.g., "post", "page", "docs")
Name string `json:"name" yaml:"name" toml:"name"`
// Directory is the output directory for this content type
Directory string `json:"directory" yaml:"directory" toml:"directory"`
// Frontmatter contains default frontmatter fields for this template
Frontmatter map[string]interface{} `json:"frontmatter,omitempty" yaml:"frontmatter,omitempty" toml:"frontmatter,omitempty"`
// Body is the default body content (markdown) for this template
Body string `json:"body,omitempty" yaml:"body,omitempty" toml:"body,omitempty"`
}
ContentTemplateConfig defines a single content template.
type ContentTemplatesConfig ¶ added in v0.5.0
type ContentTemplatesConfig struct {
// Directory is where user-defined templates are stored (default: "content-templates")
Directory string `json:"directory" yaml:"directory" toml:"directory"`
// Placement maps template names to output directories
Placement map[string]string `json:"placement" yaml:"placement" toml:"placement"`
// Templates is a list of custom template configurations
Templates []ContentTemplateConfig `json:"templates,omitempty" yaml:"templates,omitempty" toml:"templates,omitempty"`
}
ContentTemplatesConfig configures the content template system for the new command.
func NewContentTemplatesConfig ¶ added in v0.5.0
func NewContentTemplatesConfig() ContentTemplatesConfig
NewContentTemplatesConfig creates a new ContentTemplatesConfig with default values.
func (*ContentTemplatesConfig) GetPlacement ¶ added in v0.5.0
func (c *ContentTemplatesConfig) GetPlacement(templateName string) string
GetPlacement returns the output directory for a template name. Returns the template name itself if no explicit placement is configured.
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 DocsLayoutConfig ¶ added in v0.4.0
type DocsLayoutConfig struct {
// SidebarPosition controls sidebar placement: "left" or "right" (default: "left")
SidebarPosition string `json:"sidebar_position,omitempty" yaml:"sidebar_position,omitempty" toml:"sidebar_position,omitempty"`
// SidebarWidth is the width of the sidebar (default: "280px")
SidebarWidth string `json:"sidebar_width,omitempty" yaml:"sidebar_width,omitempty" toml:"sidebar_width,omitempty"`
// SidebarCollapsible allows the sidebar to be collapsed (default: true)
SidebarCollapsible *bool `json:"sidebar_collapsible,omitempty" yaml:"sidebar_collapsible,omitempty" toml:"sidebar_collapsible,omitempty"`
// SidebarDefaultOpen controls if sidebar is open by default on desktop (default: true)
SidebarDefaultOpen *bool `json:"sidebar_default_open,omitempty" yaml:"sidebar_default_open,omitempty" toml:"sidebar_default_open,omitempty"`
// TocPosition controls TOC placement: "left" or "right" (default: "right")
TocPosition string `json:"toc_position,omitempty" yaml:"toc_position,omitempty" toml:"toc_position,omitempty"`
// TocWidth is the width of the table of contents (default: "220px")
TocWidth string `json:"toc_width,omitempty" yaml:"toc_width,omitempty" toml:"toc_width,omitempty"`
// TocCollapsible allows the TOC to be collapsed (default: true)
TocCollapsible *bool `json:"toc_collapsible,omitempty" yaml:"toc_collapsible,omitempty" toml:"toc_collapsible,omitempty"`
// TocDefaultOpen controls if TOC is open by default on desktop (default: true)
TocDefaultOpen *bool `json:"toc_default_open,omitempty" yaml:"toc_default_open,omitempty" toml:"toc_default_open,omitempty"`
// ContentMaxWidth is the maximum width of the content area (default: "800px")
ContentMaxWidth string `json:"content_max_width,omitempty" yaml:"content_max_width,omitempty" toml:"content_max_width,omitempty"`
// HeaderStyle controls the header appearance: "full", "minimal", "transparent", "none" (default: "minimal")
HeaderStyle string `json:"header_style,omitempty" yaml:"header_style,omitempty" toml:"header_style,omitempty"`
FooterStyle string `json:"footer_style,omitempty" yaml:"footer_style,omitempty" toml:"footer_style,omitempty"`
}
DocsLayoutConfig configures the documentation layout. This is a 3-panel layout with sidebar navigation, content, and table of contents.
func (*DocsLayoutConfig) IsSidebarCollapsible ¶ added in v0.4.0
func (d *DocsLayoutConfig) IsSidebarCollapsible() bool
IsSidebarCollapsible returns whether the sidebar can be collapsed.
func (*DocsLayoutConfig) IsSidebarDefaultOpen ¶ added in v0.4.0
func (d *DocsLayoutConfig) IsSidebarDefaultOpen() bool
IsSidebarDefaultOpen returns whether the sidebar is open by default.
func (*DocsLayoutConfig) IsTocCollapsible ¶ added in v0.4.0
func (d *DocsLayoutConfig) IsTocCollapsible() bool
IsTocCollapsible returns whether the TOC can be collapsed.
func (*DocsLayoutConfig) IsTocDefaultOpen ¶ added in v0.4.0
func (d *DocsLayoutConfig) IsTocDefaultOpen() bool
IsTocDefaultOpen returns whether the TOC is open by default.
type EmbedsConfig ¶ added in v0.5.0
type EmbedsConfig struct {
// Enabled controls whether embed processing is active (default: true)
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
// InternalCardClass is the CSS class for internal embed cards (default: "embed-card")
InternalCardClass string `json:"internal_card_class" yaml:"internal_card_class" toml:"internal_card_class"`
// ExternalCardClass is the CSS class for external embed cards (default: "embed-card embed-card-external")
ExternalCardClass string `json:"external_card_class" yaml:"external_card_class" toml:"external_card_class"`
// FetchExternal enables fetching OG metadata for external embeds (default: true)
FetchExternal bool `json:"fetch_external" yaml:"fetch_external" toml:"fetch_external"`
// CacheDir is the directory for caching external embed metadata (default: ".cache/embeds")
CacheDir string `json:"cache_dir" yaml:"cache_dir" toml:"cache_dir"`
// Timeout is the HTTP request timeout in seconds for external fetches (default: 10)
Timeout int `json:"timeout" yaml:"timeout" toml:"timeout"`
// FallbackTitle is used when OG title cannot be fetched (default: "External Link")
FallbackTitle string `json:"fallback_title" yaml:"fallback_title" toml:"fallback_title"`
// ShowImage controls whether to display OG images in external embeds (default: true)
ShowImage bool `json:"show_image" yaml:"show_image" toml:"show_image"`
}
EmbedsConfig configures the embeds plugin for embedding internal and external content.
func NewEmbedsConfig ¶ added in v0.5.0
func NewEmbedsConfig() EmbedsConfig
NewEmbedsConfig creates a new EmbedsConfig with default values.
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 is the logo URL (for Organizations only)
Logo string `json:"logo,omitempty" yaml:"logo,omitempty" toml:"logo,omitempty"`
}
EntityConfig represents a Schema.org Person or Organization entity.
type ExternalEntry ¶ added in v0.5.0
type ExternalEntry struct {
// FeedURL is the source feed URL
FeedURL string `json:"feed_url"`
// FeedTitle is the source feed title
FeedTitle string `json:"feed_title"`
// ID is the unique identifier (GUID) for the entry
ID string `json:"id"`
// URL is the link to the full article
URL string `json:"url"`
// Title is the entry title
Title string `json:"title"`
// Description is a short summary or excerpt
Description string `json:"description"`
// Content is the full entry content (HTML)
Content string `json:"content"`
// Author is the entry author
Author string `json:"author,omitempty"`
// Published is the publication date
Published *time.Time `json:"published,omitempty"`
// Updated is the last update date
Updated *time.Time `json:"updated,omitempty"`
// Categories are the entry categories/tags
Categories []string `json:"categories,omitempty"`
// ImageURL is the entry's featured image
ImageURL string `json:"image_url,omitempty"`
// ReadingTime is estimated reading time in minutes
ReadingTime int `json:"reading_time"`
}
ExternalEntry represents a single entry/item from an external feed.
type ExternalFeed ¶ added in v0.5.0
type ExternalFeed struct {
// Config is the original configuration for this feed
Config ExternalFeedConfig `json:"config"`
// Title is the feed title (from config or fetched)
Title string `json:"title"`
// Description is the feed description
Description string `json:"description"`
// SiteURL is the main website URL
SiteURL string `json:"site_url"`
// FeedURL is the RSS/Atom feed URL
FeedURL string `json:"feed_url"`
// ImageURL is the feed's logo/icon
ImageURL string `json:"image_url"`
// Category is the feed category
Category string `json:"category"`
// Tags are the feed tags
Tags []string `json:"tags"`
// LastFetched is when the feed was last fetched
LastFetched *time.Time `json:"last_fetched,omitempty"`
// LastUpdated is the feed's last build/update date
LastUpdated *time.Time `json:"last_updated,omitempty"`
// EntryCount is the number of entries in the feed
EntryCount int `json:"entry_count"`
// Entries are the feed entries/items
Entries []*ExternalEntry `json:"entries"`
// Error holds any error that occurred during fetching
Error string `json:"error,omitempty"`
}
ExternalFeed represents a fetched and parsed external RSS/Atom feed.
type ExternalFeedConfig ¶ added in v0.5.0
type ExternalFeedConfig struct {
// URL is the feed URL (required)
URL string `json:"url" yaml:"url" toml:"url"`
// Title is the human-readable feed title (optional, fetched if not set)
Title string `json:"title" yaml:"title" toml:"title"`
// Description is a short description of the feed
Description string `json:"description" yaml:"description" toml:"description"`
// Category groups feeds together (e.g., "technology", "design")
Category string `json:"category" yaml:"category" toml:"category"`
// Tags are additional labels for filtering
Tags []string `json:"tags" yaml:"tags" toml:"tags"`
// Active controls whether this feed is fetched (default: true)
Active *bool `json:"active,omitempty" yaml:"active,omitempty" toml:"active,omitempty"`
// SiteURL is the main website URL (fetched from feed if not set)
SiteURL string `json:"site_url" yaml:"site_url" toml:"site_url"`
// ImageURL is a logo or icon for the feed
ImageURL string `json:"image_url" yaml:"image_url" toml:"image_url"`
// Handle is an optional explicit handle for @mentions (e.g., "daverupert")
// If not set, a handle is auto-generated from the domain
Handle string `json:"handle" yaml:"handle" toml:"handle"`
// Aliases are alternative names that resolve to the canonical Handle.
// For example, aliases = ["dave", "david"] allows @dave or @david to
// resolve to the same person as @daverupert. Case-insensitive.
Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty" toml:"aliases,omitempty"`
// MaxEntries overrides the global max_entries_per_feed for this feed
MaxEntries *int `json:"max_entries,omitempty" yaml:"max_entries,omitempty" toml:"max_entries,omitempty"`
// Primary marks this as the canonical/primary feed for a person (default: true for entries without PrimaryPerson)
// When a person has multiple feeds, mark the main one as primary=true
Primary *bool `json:"primary,omitempty" yaml:"primary,omitempty" toml:"primary,omitempty"`
// PrimaryPerson links this feed to a primary person's handle
// Use this to associate secondary feeds (e.g., social accounts) with a primary person
// Example: If "daverupert" is the primary handle, set primary_person="daverupert" on secondary feeds
PrimaryPerson string `json:"primary_person" yaml:"primary_person" toml:"primary_person"`
}
ExternalFeedConfig represents a configured external RSS/Atom feed.
func (*ExternalFeedConfig) GetMaxEntries ¶ added in v0.5.0
func (f *ExternalFeedConfig) GetMaxEntries(globalDefault int) int
GetMaxEntries returns the per-feed max_entries if set, otherwise the global default.
func (*ExternalFeedConfig) IsActive ¶ added in v0.5.0
func (f *ExternalFeedConfig) IsActive() bool
IsActive returns whether the feed is active (defaults to true).
func (*ExternalFeedConfig) IsPrimary ¶ added in v0.5.0
func (f *ExternalFeedConfig) IsPrimary() bool
IsPrimary returns whether this is a primary feed (defaults to true if PrimaryPerson is not set).
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"`
// Type is the feed type (blog, series, guide)
Type FeedType `json:"type" yaml:"type" toml:"type"`
// 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"`
// Sidebar enables auto-generation of sidebar navigation from this feed's posts
Sidebar bool `json:"sidebar" yaml:"sidebar" toml:"sidebar"`
// SidebarTitle overrides the feed title in sidebar navigation
SidebarTitle string `json:"sidebar_title" yaml:"sidebar_title" toml:"sidebar_title"`
// SidebarOrder controls the position in multi-feed sidebars (lower = first, default: 0)
SidebarOrder int `json:"sidebar_order" yaml:"sidebar_order" toml:"sidebar_order"`
// SidebarGroupBy groups posts by a frontmatter field in the sidebar (e.g., "category")
SidebarGroupBy string `json:"sidebar_group_by" yaml:"sidebar_group_by" toml:"sidebar_group_by"`
// 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) GetSidebarTitle ¶ added in v0.4.0
func (f *FeedConfig) GetSidebarTitle() string
GetSidebarTitle returns the effective title for sidebar navigation. Returns SidebarTitle if set, otherwise returns Title.
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 ¶
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 *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`
Text string `json:"text,omitempty" yaml:"text,omitempty" toml:"text,omitempty"`
ShowCopyright *bool `json:"show_copyright,omitempty" yaml:"show_copyright,omitempty" toml:"show_copyright,omitempty"`
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 string `json:"text,omitempty" yaml:"text,omitempty" toml:"text,omitempty"`
ShowCopyright *bool `json:"show_copyright,omitempty" yaml:"show_copyright,omitempty" toml:"show_copyright,omitempty"`
}
FooterConfig configures the site footer.
type FooterLayoutConfig ¶ added in v0.4.0
type FooterLayoutConfig struct {
Style string `json:"style,omitempty" yaml:"style,omitempty" toml:"style,omitempty"`
Sticky *bool `json:"sticky,omitempty" yaml:"sticky,omitempty" toml:"sticky,omitempty"`
ShowCopyright *bool `json:"show_copyright,omitempty" yaml:"show_copyright,omitempty" toml:"show_copyright,omitempty"`
CopyrightText string `json:"copyright_text,omitempty" yaml:"copyright_text,omitempty" toml:"copyright_text,omitempty"`
ShowSocialLinks *bool `json:"show_social_links,omitempty" yaml:"show_social_links,omitempty" toml:"show_social_links,omitempty"`
ShowNavLinks *bool `json:"show_nav_links,omitempty" yaml:"show_nav_links,omitempty" toml:"show_nav_links,omitempty"`
}
FooterLayoutConfig configures the footer component for layouts.
func NewFooterLayoutConfig ¶ added in v0.4.0
func NewFooterLayoutConfig() FooterLayoutConfig
NewFooterLayoutConfig creates a new FooterLayoutConfig with default values.
func (*FooterLayoutConfig) IsShowCopyright ¶ added in v0.4.0
func (f *FooterLayoutConfig) IsShowCopyright() bool
IsShowCopyright returns whether to show the copyright.
func (*FooterLayoutConfig) IsShowNavLinks ¶ added in v0.4.0
func (f *FooterLayoutConfig) IsShowNavLinks() bool
IsShowNavLinks returns whether to show nav links in footer.
func (*FooterLayoutConfig) IsShowSocialLinks ¶ added in v0.4.0
func (f *FooterLayoutConfig) IsShowSocialLinks() bool
IsShowSocialLinks returns whether to show social links.
func (*FooterLayoutConfig) IsSticky ¶ added in v0.4.0
func (f *FooterLayoutConfig) IsSticky() bool
IsSticky returns whether the footer should be sticky.
type FrontmatterParseError ¶
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 HeaderLayoutConfig ¶ added in v0.4.0
type HeaderLayoutConfig struct {
// Style controls the header appearance: "full", "minimal", "transparent", "none" (default: "full")
Style string `json:"style,omitempty" yaml:"style,omitempty" toml:"style,omitempty"`
// Sticky makes the header stick to the top when scrolling (default: true)
Sticky *bool `json:"sticky,omitempty" yaml:"sticky,omitempty" toml:"sticky,omitempty"`
// ShowLogo displays the site logo (default: true)
ShowLogo *bool `json:"show_logo,omitempty" yaml:"show_logo,omitempty" toml:"show_logo,omitempty"`
// ShowTitle displays the site title (default: true)
ShowTitle *bool `json:"show_title,omitempty" yaml:"show_title,omitempty" toml:"show_title,omitempty"`
ShowNav *bool `json:"show_nav,omitempty" yaml:"show_nav,omitempty" toml:"show_nav,omitempty"`
// ShowSearch displays the search box (default: true)
ShowSearch *bool `json:"show_search,omitempty" yaml:"show_search,omitempty" toml:"show_search,omitempty"`
// ShowThemeToggle displays the theme toggle button (default: true)
ShowThemeToggle *bool `json:"show_theme_toggle,omitempty" yaml:"show_theme_toggle,omitempty" toml:"show_theme_toggle,omitempty"`
}
HeaderLayoutConfig configures the header component for layouts.
func NewHeaderLayoutConfig ¶ added in v0.4.0
func NewHeaderLayoutConfig() HeaderLayoutConfig
NewHeaderLayoutConfig creates a new HeaderLayoutConfig with default values.
func (*HeaderLayoutConfig) IsShowLogo ¶ added in v0.4.0
func (h *HeaderLayoutConfig) IsShowLogo() bool
IsShowLogo returns whether to show the logo.
func (*HeaderLayoutConfig) IsShowNav ¶ added in v0.4.0
func (h *HeaderLayoutConfig) IsShowNav() bool
IsShowNav returns whether to show navigation.
func (*HeaderLayoutConfig) IsShowSearch ¶ added in v0.4.0
func (h *HeaderLayoutConfig) IsShowSearch() bool
IsShowSearch returns whether to show the search box.
func (*HeaderLayoutConfig) IsShowThemeToggle ¶ added in v0.4.0
func (h *HeaderLayoutConfig) IsShowThemeToggle() bool
IsShowThemeToggle returns whether to show the theme toggle.
func (*HeaderLayoutConfig) IsShowTitle ¶ added in v0.4.0
func (h *HeaderLayoutConfig) IsShowTitle() bool
IsShowTitle returns whether to show the title.
func (*HeaderLayoutConfig) IsSticky ¶ added in v0.4.0
func (h *HeaderLayoutConfig) IsSticky() bool
IsSticky returns whether the header should be sticky.
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
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 LandingLayoutConfig ¶ added in v0.4.0
type LandingLayoutConfig struct {
// ContentMaxWidth is the maximum width of the content area (default: "100%")
ContentMaxWidth string `json:"content_max_width,omitempty" yaml:"content_max_width,omitempty" toml:"content_max_width,omitempty"`
// HeaderStyle controls the header appearance: "full", "minimal", "transparent", "none" (default: "transparent")
HeaderStyle string `json:"header_style,omitempty" yaml:"header_style,omitempty" toml:"header_style,omitempty"`
// HeaderSticky makes the header stick when scrolling (default: true)
HeaderSticky *bool `json:"header_sticky,omitempty" yaml:"header_sticky,omitempty" toml:"header_sticky,omitempty"`
FooterStyle string `json:"footer_style,omitempty" yaml:"footer_style,omitempty" toml:"footer_style,omitempty"`
// HeroEnabled enables the hero section (default: true)
HeroEnabled *bool `json:"hero_enabled,omitempty" yaml:"hero_enabled,omitempty" toml:"hero_enabled,omitempty"`
}
LandingLayoutConfig configures the landing page layout. This is a full-width layout for marketing pages and home pages.
func (*LandingLayoutConfig) IsHeaderSticky ¶ added in v0.4.0
func (l *LandingLayoutConfig) IsHeaderSticky() bool
IsHeaderSticky returns whether the header should be sticky.
func (*LandingLayoutConfig) IsHeroEnabled ¶ added in v0.4.0
func (l *LandingLayoutConfig) IsHeroEnabled() bool
IsHeroEnabled returns whether the hero section is enabled.
type LayoutConfig ¶ added in v0.4.0
type LayoutConfig struct {
// Name is the default layout preset name (default: "blog")
// Options: "docs", "blog", "landing", "bare"
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Paths maps URL path prefixes to layout names for automatic layout selection.
// Example: {"/docs/": "docs", "/blog/": "blog", "/about/": "landing"}
Paths map[string]string `json:"paths,omitempty" yaml:"paths,omitempty" toml:"paths,omitempty"`
// Feeds maps feed slugs to layout names for automatic layout selection.
// Example: {"docs": "docs", "blog": "blog"}
Feeds map[string]string `json:"feeds,omitempty" yaml:"feeds,omitempty" toml:"feeds,omitempty"`
// Docs configures the documentation layout
Docs DocsLayoutConfig `json:"docs,omitempty" yaml:"docs,omitempty" toml:"docs,omitempty"`
// Blog configures the blog layout
Blog BlogLayoutConfig `json:"blog,omitempty" yaml:"blog,omitempty" toml:"blog,omitempty"`
// Landing configures the landing page layout
Landing LandingLayoutConfig `json:"landing,omitempty" yaml:"landing,omitempty" toml:"landing,omitempty"`
// Bare configures the bare layout (content only)
Bare BareLayoutConfig `json:"bare,omitempty" yaml:"bare,omitempty" toml:"bare,omitempty"`
// Defaults provides global layout defaults
Defaults LayoutDefaults `json:"defaults,omitempty" yaml:"defaults,omitempty" toml:"defaults,omitempty"`
}
LayoutConfig configures the site layout system. Layouts control the overall page structure including sidebars, TOC, header, and footer.
func NewLayoutConfig ¶ added in v0.4.0
func NewLayoutConfig() LayoutConfig
NewLayoutConfig creates a new LayoutConfig with default values.
func (*LayoutConfig) ResolveLayout ¶ added in v0.4.0
func (l *LayoutConfig) ResolveLayout(postPath, feedSlug string) string
ResolveLayout determines the appropriate layout for a post based on its path and feed. Priority: path-based > feed-based > global default Returns the layout name (e.g., "docs", "blog", "landing", "bare") or empty string if no match.
type LayoutDefaults ¶ added in v0.4.0
type LayoutDefaults struct {
// ContentMaxWidth is the maximum width of the content area (default: "800px")
ContentMaxWidth string `json:"content_max_width,omitempty" yaml:"content_max_width,omitempty" toml:"content_max_width,omitempty"`
// HeaderSticky makes the header stick to the top when scrolling (default: true)
HeaderSticky *bool `json:"header_sticky,omitempty" yaml:"header_sticky,omitempty" toml:"header_sticky,omitempty"`
FooterSticky *bool `json:"footer_sticky,omitempty" yaml:"footer_sticky,omitempty" toml:"footer_sticky,omitempty"`
}
LayoutDefaults provides global layout defaults.
func (*LayoutDefaults) IsFooterSticky ¶ added in v0.4.0
func (d *LayoutDefaults) IsFooterSticky() bool
IsFooterSticky returns whether the footer should be sticky.
func (*LayoutDefaults) IsHeaderSticky ¶ added in v0.4.0
func (d *LayoutDefaults) IsHeaderSticky() bool
IsHeaderSticky returns whether the header should be sticky.
type Link ¶
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 (*Link) SourceSlug ¶
SourceSlug returns the slug of the source post, or empty string if nil.
func (*Link) SourceTitle ¶
SourceTitle returns the title of the source post, or empty string if nil.
func (*Link) TargetSlug ¶
TargetSlug returns the slug of the target post, or empty string if nil.
func (*Link) TargetTitle ¶
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 MultiFeedSection ¶ added in v0.4.0
type MultiFeedSection struct {
// Feed is the feed slug to include in this section
Feed string `json:"feed" yaml:"feed" toml:"feed"`
// Title overrides the feed title for this section
Title string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`
// Collapsed starts this section collapsed (default: false for first, true for others)
Collapsed *bool `json:"collapsed,omitempty" yaml:"collapsed,omitempty" toml:"collapsed,omitempty"`
// MaxItems limits the number of items shown (0 = unlimited, default: 0)
MaxItems int `json:"max_items,omitempty" yaml:"max_items,omitempty" toml:"max_items,omitempty"`
}
MultiFeedSection represents a section in a multi-feed sidebar.
func (*MultiFeedSection) IsCollapsed ¶ added in v0.4.0
func (m *MultiFeedSection) IsCollapsed() bool
IsCollapsed returns whether the section should start collapsed.
type NavComponentConfig ¶ added in v0.3.0
type NavComponentConfig struct {
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`
Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`
Style string `json:"style,omitempty" yaml:"style,omitempty" toml:"style,omitempty"`
Items []NavItem `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
}
NavComponentConfig configures the navigation component.
type NavItem ¶ added in v0.3.0
type NavItem struct {
Label string `json:"label" yaml:"label" toml:"label"`
URL string `json:"url" yaml:"url" toml:"url"`
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"`
// Verbose enables verbose output from Pagefind (default: false)
// When false, only errors are shown. When true or when --verbose CLI flag is used, all output is shown.
Verbose *bool `json:"verbose,omitempty" yaml:"verbose,omitempty" toml:"verbose,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.
func (*PagefindConfig) IsVerbose ¶ added in v0.5.0
func (p *PagefindConfig) IsVerbose() bool
IsVerbose returns whether verbose output is enabled. Defaults to false 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 PathSidebarConfig ¶ added in v0.4.0
type PathSidebarConfig struct {
// Title is the optional sidebar title/header for this path
Title string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`
// AutoGenerate configures auto-generation from directory structure
AutoGenerate *SidebarAutoGenerate `json:"auto_generate,omitempty" yaml:"auto_generate,omitempty" toml:"auto_generate,omitempty"`
// Items is the manual navigation structure for this path
Items []SidebarNavItem `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
// Feed links this sidebar to a specific feed slug for auto-generation
Feed string `json:"feed,omitempty" yaml:"feed,omitempty" toml:"feed,omitempty"`
// Position overrides the default sidebar position for this path
Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`
// Collapsible overrides the default collapsible setting for this path
Collapsible *bool `json:"collapsible,omitempty" yaml:"collapsible,omitempty" toml:"collapsible,omitempty"`
}
PathSidebarConfig configures a sidebar for a specific URL path prefix.
func (*PathSidebarConfig) IsCollapsible ¶ added in v0.4.0
func (p *PathSidebarConfig) IsCollapsible() bool
IsCollapsible returns whether the path sidebar is collapsible.
type PluginNotFoundError ¶
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 (*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"
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 ¶
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 ReaderPage ¶ added in v0.5.0
type ReaderPage struct {
// Number is the page number (1-indexed)
Number int `json:"number" yaml:"number" toml:"number"`
// Entries is the list of entries on this page
Entries []*ExternalEntry `json:"entries" yaml:"entries" toml:"entries"`
// 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
TotalPages int `json:"total_pages" yaml:"total_pages" toml:"total_pages"`
// TotalItems is the total number of entries
TotalItems int `json:"total_items" yaml:"total_items" toml:"total_items"`
// ItemsPerPage is the number of entries 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"`
}
ReaderPage represents a single page of paginated reader entries.
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"`
Logo *ImageObject `json:"logo,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 (*SchemaAgent) WithLogo ¶ added in v0.3.0
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 SidebarAutoGenerate ¶ added in v0.4.0
type SidebarAutoGenerate struct {
// Directory is the source directory for auto-generation (relative to content root)
Directory string `json:"directory,omitempty" yaml:"directory,omitempty" toml:"directory,omitempty"`
// OrderBy specifies how to order items: "title", "date", "nav_order", "filename" (default: "filename")
OrderBy string `json:"order_by,omitempty" yaml:"order_by,omitempty" toml:"order_by,omitempty"`
// Reverse reverses the sort order (default: false)
Reverse *bool `json:"reverse,omitempty" yaml:"reverse,omitempty" toml:"reverse,omitempty"`
// MaxDepth limits how deep to recurse into subdirectories (0 = unlimited, default: 0)
MaxDepth int `json:"max_depth,omitempty" yaml:"max_depth,omitempty" toml:"max_depth,omitempty"`
// Exclude is a list of glob patterns to exclude from auto-generation
Exclude []string `json:"exclude,omitempty" yaml:"exclude,omitempty" toml:"exclude,omitempty"`
}
SidebarAutoGenerate configures automatic sidebar generation from a directory or feed.
func (*SidebarAutoGenerate) IsReverse ¶ added in v0.4.0
func (a *SidebarAutoGenerate) IsReverse() bool
IsReverse returns whether to reverse the sort order.
type SidebarConfig ¶ added in v0.4.0
type SidebarConfig struct {
// Enabled controls whether the sidebar is displayed (default: true for docs layout)
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`
// Position controls sidebar placement: "left" or "right" (default: "left")
Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`
// Width is the sidebar width (default: "280px")
Width string `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`
// Collapsible allows the sidebar to be collapsed (default: true)
Collapsible *bool `json:"collapsible,omitempty" yaml:"collapsible,omitempty" toml:"collapsible,omitempty"`
// DefaultOpen controls if sidebar is open by default (default: true)
DefaultOpen *bool `json:"default_open,omitempty" yaml:"default_open,omitempty" toml:"default_open,omitempty"`
Nav []SidebarNavItem `json:"nav,omitempty" yaml:"nav,omitempty" toml:"nav,omitempty"`
// Title is the optional sidebar title/header
Title string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`
// Paths maps URL path prefixes to path-specific sidebar configs
// Keys should be paths like "/docs/", "/blog/", "/guides/"
Paths map[string]*PathSidebarConfig `json:"paths,omitempty" yaml:"paths,omitempty" toml:"paths,omitempty"`
// MultiFeed enables multi-feed mode with collapsible sections
MultiFeed *bool `json:"multi_feed,omitempty" yaml:"multi_feed,omitempty" toml:"multi_feed,omitempty"`
// Feeds is the list of feed slugs to show in multi-feed mode
Feeds []string `json:"feeds,omitempty" yaml:"feeds,omitempty" toml:"feeds,omitempty"`
// FeedSections provides detailed config for multi-feed sections
FeedSections []MultiFeedSection `json:"feed_sections,omitempty" yaml:"feed_sections,omitempty" toml:"feed_sections,omitempty"`
// AutoGenerate configures default auto-generation settings
AutoGenerate *SidebarAutoGenerate `json:"auto_generate,omitempty" yaml:"auto_generate,omitempty" toml:"auto_generate,omitempty"`
}
SidebarConfig configures the sidebar navigation component.
func NewSidebarConfig ¶ added in v0.4.0
func NewSidebarConfig() SidebarConfig
NewSidebarConfig creates a new SidebarConfig with default values.
func (*SidebarConfig) GetEffectiveConfig ¶ added in v0.4.0
func (s *SidebarConfig) GetEffectiveConfig(path string) *SidebarConfig
GetEffectiveConfig returns an effective sidebar configuration for a path, merging path-specific settings with the default sidebar config.
func (*SidebarConfig) IsCollapsible ¶ added in v0.4.0
func (s *SidebarConfig) IsCollapsible() bool
IsCollapsible returns whether the sidebar can be collapsed.
func (*SidebarConfig) IsDefaultOpen ¶ added in v0.4.0
func (s *SidebarConfig) IsDefaultOpen() bool
IsDefaultOpen returns whether the sidebar is open by default.
func (*SidebarConfig) IsEnabled ¶ added in v0.4.0
func (s *SidebarConfig) IsEnabled() bool
IsEnabled returns whether the sidebar is enabled.
func (*SidebarConfig) IsMultiFeed ¶ added in v0.4.0
func (s *SidebarConfig) IsMultiFeed() bool
IsMultiFeed returns whether multi-feed mode is enabled.
func (*SidebarConfig) ResolveForPath ¶ added in v0.4.0
func (s *SidebarConfig) ResolveForPath(path string) (*PathSidebarConfig, bool)
ResolveForPath finds the best matching sidebar configuration for a given path. It checks path-specific sidebars and returns the most specific match (longest prefix wins). Returns the matching PathSidebarConfig and true if found, or nil and false otherwise.
type SidebarNavItem ¶ added in v0.4.0
type SidebarNavItem struct {
Title string `json:"title" yaml:"title" toml:"title"`
Href string `json:"href,omitempty" yaml:"href,omitempty" toml:"href,omitempty"`
Children []SidebarNavItem `json:"children,omitempty" yaml:"children,omitempty" toml:"children,omitempty"`
}
SidebarNavItem represents a navigation item in the sidebar.
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 ¶
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 ¶
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 base color palette to use (default: "default-light")
// When set to a base name like "everforest", the system will auto-detect
// light/dark variants (e.g., "everforest-light" and "everforest-dark")
Palette string `json:"palette" yaml:"palette" toml:"palette"`
// PaletteLight is the palette to use for light mode (optional)
// If not set, auto-detected from base Palette name
PaletteLight string `json:"palette_light,omitempty" yaml:"palette_light,omitempty" toml:"palette_light,omitempty"`
// PaletteDark is the palette to use for dark mode (optional)
// If not set, auto-detected from base Palette name
PaletteDark string `json:"palette_dark,omitempty" yaml:"palette_dark,omitempty" toml:"palette_dark,omitempty"`
// 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 TocConfig ¶ added in v0.4.0
type TocConfig struct {
// Enabled controls whether the TOC is displayed (default: true for docs layout)
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`
// Position controls TOC placement: "left" or "right" (default: "right")
Position string `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`
// Width is the TOC width (default: "220px")
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"`
// Title is the TOC section title (default: "On this page")
Title string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`
// Collapsible allows the TOC to be collapsed (default: true)
Collapsible *bool `json:"collapsible,omitempty" yaml:"collapsible,omitempty" toml:"collapsible,omitempty"`
// DefaultOpen controls if TOC is open by default (default: true)
DefaultOpen *bool `json:"default_open,omitempty" yaml:"default_open,omitempty" toml:"default_open,omitempty"`
// ScrollSpy enables highlighting the current section (default: true)
ScrollSpy *bool `json:"scroll_spy,omitempty" yaml:"scroll_spy,omitempty" toml:"scroll_spy,omitempty"`
}
TocConfig configures the table of contents component.
func NewTocConfig ¶ added in v0.4.0
func NewTocConfig() TocConfig
NewTocConfig creates a new TocConfig with default values.
func (*TocConfig) IsCollapsible ¶ added in v0.4.0
IsCollapsible returns whether the TOC can be collapsed.
func (*TocConfig) IsDefaultOpen ¶ added in v0.4.0
IsDefaultOpen returns whether the TOC is open by default.
func (*TocConfig) IsScrollSpy ¶ added in v0.4.0
IsScrollSpy returns whether scroll spy is enabled.
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 WebMentionsConfig ¶ added in v0.5.0
type WebMentionsConfig struct {
// Enabled controls whether the webmentions plugin is active (default: false)
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
// Outgoing enables sending webmentions for external links (default: true when enabled)
Outgoing bool `json:"outgoing" yaml:"outgoing" toml:"outgoing"`
// UserAgent is the User-Agent string for HTTP requests
UserAgent string `json:"user_agent" yaml:"user_agent" toml:"user_agent"`
// Timeout is the HTTP request timeout (e.g., "30s")
Timeout string `json:"timeout" yaml:"timeout" toml:"timeout"`
// CacheDir is the directory for caching sent webmentions (default: ".cache/webmentions")
CacheDir string `json:"cache_dir" yaml:"cache_dir" toml:"cache_dir"`
// ConcurrentRequests is the max number of concurrent webmention requests (default: 5)
ConcurrentRequests int `json:"concurrent_requests" yaml:"concurrent_requests" toml:"concurrent_requests"`
// Bridges configures social media bridging for incoming webmentions
Bridges BridgesConfig `json:"bridges" yaml:"bridges" toml:"bridges"`
// WebmentionIOToken is the API token for webmention.io (for receiving mentions)
WebmentionIOToken string `json:"webmention_io_token" yaml:"webmention_io_token" toml:"webmention_io_token"`
}
WebMentionsConfig configures the webmentions plugin for sending outgoing mentions. This is separate from WebmentionConfig which handles receiving mentions.
func NewWebMentionsConfig ¶ added in v0.5.0
func NewWebMentionsConfig() WebMentionsConfig
NewWebMentionsConfig creates a new WebMentionsConfig with default values.
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
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.