VOOZH about

URL: https://deepwiki.com/calevans/staticforge/8-built-in-features-reference

⇱ Built-in Features Reference | calevans/staticforge | DeepWiki


Loading...
Last indexed: 11 February 2026 (5f6a2a)
Menu

Built-in Features Reference

This page provides a comprehensive reference for all features shipped with StaticForge. Features are modular, event-driven components that extend the core functionality of the static site generator. Each feature operates independently through the event system, enabling or disabling features without affecting the core build process.

For information about creating custom features, see Creating Custom Features. For the conceptual overview of the feature system architecture, see Feature System.


Feature Discovery System

StaticForge discovers features from three locations with explicit priority ordering, allowing user-defined features to override library implementations.


Sources: src/Core/FeatureManager.php52-96 src/Core/FeatureManager.php146-231

Discovery Priority Rules

Priority LevelLocationOverride Behavior
HIGHESTsrc/Features/*/Feature.phpUser features can disable library features
MEDIUMvendor/**/composer.json extra.staticforge.featureThird-party packages
LOWESTvendor/eicc/staticforge/src/Features/*/Feature.phpLibrary defaults

Features are identified by their getName() method return value. If a feature with the same name is loaded from a higher-priority location, the lower-priority version is skipped.

Sources: src/Core/FeatureManager.php52-85 src/Core/FeatureManager.php269-280


Feature Registration Architecture

All features extend BaseFeature or BaseRendererFeature and implement FeatureInterface. Registration occurs during bootstrap before any content processing begins.


Example Registration: src/Features/MarkdownRenderer/Feature.php33-69

Event Subscription Pattern

Features declare event listeners using the eventListeners array property:


The BaseFeature class automatically registers these listeners during register(), mapping event names to feature methods with priority values.

Sources: src/Features/MarkdownRenderer/Feature.php29-31 src/Features/MenuBuilder/Feature.php26-28


Built-in Features Catalog

The following table catalogs all features shipped with StaticForge, organized by functional category.

Feature NameEventsPriorityFile TypesPurpose
Content Renderers
MarkdownRendererRENDER100.mdConverts Markdown to HTML, applies templates
HtmlRendererRENDER100.htmlProcesses HTML files, applies templates
Navigation & Structure
MenuBuilderPOST_GLOB100N/AGenerates navigation menus from frontmatter menu field
CategoriesPOST_RENDER100N/AOrganizes content by category, modifies URLs
CategoryIndexPOST_GLOB, PRE_RENDER, POST_RENDER, POST_LOOP50-150N/AGenerates category index pages with pagination
ChapterNavPOST_RENDER100N/ACreates previous/next navigation for sequential content
TagsPOST_RENDER, POST_LOOP100N/ACollects tags, generates tag cloud
SEO & Discovery
SitemapPOST_RENDER, POST_LOOP100N/AGenerates sitemap.xml from all pages
RssFeedPOST_RENDER, POST_LOOP100N/AGenerates RSS feeds per category
RobotsTxtPOST_GLOB, POST_LOOP100-150N/AGenerates robots.txt honoring metadata
Interactive
FormsRENDER50N/AProcesses form shortcodes with AJAX, spam protection
SearchPOST_RENDER, POST_LOOP100N/ABuilds client-side search index
Deployment & Optimization
CacheBusterCREATE, RENDER100N/AGenerates unique build IDs for asset cache invalidation
TemplateAssetsPOST_LOOP100N/ACopies template assets to output directory
UploadN/AN/AN/AUploads built site to SFTP or S3

Sources: src/Features/MarkdownRenderer/Feature.php22 src/Features/HtmlRenderer/Feature.php22 src/Features/MenuBuilder/Feature.php19 src/Features/CategoryIndex/Feature.php23 src/Features/RssFeed/Services/RssFeedService.php src/Features/RobotsTxt/Feature.php32 src/Features/Sitemap/Services/SitemapService.php


Event Lifecycle Integration

Features hook into specific stages of the generation pipeline through event subscriptions. The following diagram maps features to their primary event hooks.


Sources: src/Features/MarkdownRenderer/Feature.php29-31 src/Features/MenuBuilder/Feature.php26-28 src/Features/CategoryIndex/Feature.php33-39

Priority-Based Execution Order

Within each event, features execute in priority order (lower numbers first). Critical examples:

  • POST_GLOB: CategoryIndex (50) runs before MenuBuilder (100), ensuring category index pages exist before menu generation
  • PRE_RENDER: CategoryIndex (150) can defer category definition files before renderers process them
  • RENDER: Forms (50) processes shortcodes before MarkdownRenderer and HtmlRenderer (100)

Sources: src/Features/CategoryIndex/Feature.php33-39 src/Features/MenuBuilder/Feature.php26-28


Feature Service Architecture

Complex features delegate logic to service classes, keeping the main Feature.php focused on event handling and registration.


Example Service Delegation:

Sources: src/Features/MarkdownRenderer/Feature.php33-69 src/Features/MenuBuilder/Feature.php40-74 src/Features/CategoryIndex/Feature.php42-53


Feature Configuration Interface

Features requiring configuration implement ConfigurableFeatureInterface, enabling validation via the audit:config command.


Example Implementation: src/Features/MenuBuilder/Feature.php30-38

Features without configuration requirements return empty arrays from both methods.

Sources: src/Features/MenuBuilder/Feature.php17-38


Feature Disabling Mechanism

Features can be disabled via siteconfig.yaml using the disabled_features list:


The FeatureManager checks this list during discovery and skips registration for disabled features.

Sources: src/Core/FeatureManager.php59-63 src/Core/FeatureManager.php138-141 src/Core/FeatureManager.php210-214


Extension Registry Integration

Renderer features register file extensions they can process using ExtensionRegistry:


Only files with registered extensions are passed to the RENDER event, preventing unnecessary processing.

Sources: src/Features/MarkdownRenderer/Feature.php65-66 src/Features/HtmlRenderer/Feature.php56-57


Feature Data Storage

Features store processed data in the Container under the features variable, making it available to templates:


Each feature is responsible for structuring its own data namespace under features[FeatureName].

Sources: src/Core/FeatureManager.php87-93


Detailed Feature Documentation

The following subsections provide in-depth documentation for each feature category:

Each subsection documents event handling specifics, configuration requirements, usage examples, and service architecture for the features in that category.