| Crates.io | systemprompt-generator |
| lib.rs | systemprompt-generator |
| version | 0.0.11 |
| created_at | 2026-01-21 20:47:04.884063+00 |
| updated_at | 2026-01-25 21:43:34.439262+00 |
| description | Static site generation for systemprompt.io |
| homepage | https://systemprompt.io |
| repository | https://github.com/systempromptio/systemprompt-core |
| max_upload_size | |
| id | 2060087 |
| size | 285,696 |
Static site generation and content publishing orchestrator for systemprompt.io. Coordinates domain services to generate prerendered HTML pages, sitemaps, RSS feeds, and optimized assets.
This application-layer crate orchestrates the full content publishing pipeline:
src/
├── lib.rs # Public API exports
├── api.rs # HTTP API content fetching
├── assets.rs # Asset copying and organization
│
├── build/ # Web build orchestration
│ ├── mod.rs # Module exports
│ ├── orchestrator.rs # BuildOrchestrator, BuildMode, BuildError
│ ├── steps.rs # Theme, TypeScript, Vite, CSS build steps
│ └── validation.rs # Sitemap URL validation
│
├── content/ # Content processing
│ ├── mod.rs # Module exports
│ ├── cards.rs # Card HTML generation, image URL normalization
│ └── markdown.rs # Markdown rendering, frontmatter extraction
│
├── jobs/ # Scheduled job definitions
│ ├── mod.rs # Module exports
│ ├── copy_assets.rs # CopyExtensionAssetsJob
│ └── publish_content.rs # PublishContentJob (main pipeline)
│
├── prerender/ # Static page generation
│ ├── mod.rs # Module exports
│ ├── engine.rs # prerender_content, prerender_homepage entry points
│ ├── context.rs # PrerenderContext, HomepageBranding
│ ├── content.rs # Source processing, item rendering
│ ├── fetch.rs # Database content fetching with retries
│ ├── homepage.rs # Homepage-specific rendering
│ ├── index.rs # GenerateParentIndexParams, parent index generation
│ └── parent.rs # RenderParentParams, parent route rendering
│
├── rss/ # RSS feed generation
│ ├── mod.rs # Module exports
│ ├── generator.rs # generate_feed entry point
│ └── xml.rs # RssChannel, RssItem, XML building
│
├── sitemap/ # Sitemap generation
│ ├── mod.rs # Module exports
│ ├── generator.rs # generate_sitemap entry point
│ └── xml.rs # SitemapUrl, XML building
│
└── templates/ # Template data preparation
├── mod.rs # Module exports
├── engine.rs # load_web_config, get_templates_path
├── html.rs # Related content, CTA links, references HTML
├── items.rs # find_latest_items, find_popular_items
├── navigation.rs # Footer, social action bar HTML generation
├── paper.rs # Paper content type: TOC, sections, read time
└── data/ # Template data preparation (split for maintainability)
├── mod.rs # prepare_template_data entry point
├── types.rs # TemplateDataParams, DateData, ImageData, etc.
├── extractors.rs # Config and field extraction functions
└── builders.rs # JSON template building
| Module | Purpose |
|---|---|
build |
Orchestrates web frontend build: theme generation, TypeScript, Vite, CSS |
content |
Markdown rendering and content card HTML generation |
jobs |
Scheduled jobs implementing the Job trait for the scheduler |
prerender |
Static HTML generation for content pages and homepage |
rss |
RSS 2.0 feed generation with Atom namespace support |
sitemap |
XML sitemap generation with chunking for large sites |
templates |
Template data preparation and HTML fragment generation |
| Type | Description |
|---|---|
BuildOrchestrator |
Coordinates theme, TypeScript, Vite, and CSS build steps |
BuildMode |
Development, Production, or Docker build configuration |
PrerenderContext |
Shared context for prerendering: db pool, config, templates |
PublishContentJob |
Main job that runs the full publishing pipeline |
SitemapUrl |
URL entry for sitemap XML generation |
RssChannel / RssItem |
RSS feed data structures |
TemplateDataParams |
Parameters for preparing template data |
pub use assets::{copy_implementation_assets, organize_css_files, organize_js_files};
pub use build::{BuildError, BuildMode, BuildOrchestrator};
pub use content::{extract_frontmatter, render_markdown};
pub use prerender::{prerender_content, prerender_homepage};
pub use rss::{build_rss_xml, generate_feed, RssChannel, RssItem};
pub use sitemap::{build_sitemap_index, build_sitemap_xml, generate_sitemap, SitemapUrl};
pub use templates::{generate_footer_html, load_web_config, prepare_template_data};
pub use jobs::{CopyExtensionAssetsJob, PublishContentJob};
| Crate | Purpose |
|---|---|
systemprompt-database |
Database connection pool |
systemprompt-content |
Content repository and models |
systemprompt-templates |
Template registry and rendering |
systemprompt-models |
Configuration and domain types |
systemprompt-identifiers |
Typed identifiers (SourceId, ContentId) |
systemprompt-traits |
Job trait interface |
systemprompt-extension |
Extension discovery and assets |
systemprompt-files |
File storage configuration |
handlebars |
Template engine |
comrak |
Markdown to HTML |
This crate follows the application layer pattern:
ContentRepository for data fetchingsystemprompt_traits::Job for schedulingTemplateRegistry from domain layerConfig::get() instead of direct env::var()Add to your Cargo.toml:
[dependencies]
systemprompt-generator = "0.0.1"
FSL-1.1-ALv2 - See LICENSE for details.