Expand description
Static Site Generation for Ox Content.
This crate provides HTML page generation for documentation sites, including navigation, table of contents, search functionality, and theming support.
§Features
- Full HTML page generation with responsive layout
- Navigation sidebar with grouping
- Table of contents generation
- Client-side search integration
- Dark/light theme support
- Mobile-friendly responsive design
- Customizable theme configuration
§Example
ⓘ
use ox_content_ssg::{generate_html, PageData, NavGroup, NavItem, SsgConfig, TocEntry};
let page_data = PageData {
title: "Getting Started".to_string(),
description: Some("Learn how to use ox-content".to_string()),
content: "<h1>Getting Started</h1><p>Welcome!</p>".to_string(),
toc: vec![TocEntry { depth: 1, text: "Getting Started".to_string(), slug: "getting-started".to_string() }],
path: "getting-started".to_string(),
entry_page: None,
};
let nav_groups = vec![NavGroup {
title: "Guide".to_string(),
items: vec![NavItem {
title: "Getting Started".to_string(),
path: "getting-started".to_string(),
href: "/docs/getting-started/index.html".to_string(),
}],
}];
let config = SsgConfig {
site_name: "My Docs".to_string(),
base: "/docs/".to_string(),
og_image: None,
theme: None,
};
let html = generate_html(&page_data, &nav_groups, &config);Structs§
- Entry
Page Config - Entry page configuration (for landing pages with hero and features).
- Feature
Config - Feature card configuration.
- Hero
Action - Hero action button.
- Hero
Config - Hero section configuration.
- Hero
Image - Hero image configuration.
- Hero
Notice Config - Hero notice configuration.
- Locale
Info - Locale information for the locale switcher.
- NavGroup
- Navigation group for SSG.
- NavItem
- Navigation item for SSG.
- Page
Data - Page data for SSG.
- Social
Links - Social links configuration.
- SsgConfig
- SSG configuration.
- Theme
Colors - Theme color configuration.
- Theme
Config - Complete theme configuration.
- Theme
Embed - Embedded HTML content for specific positions in the page layout.
- Theme
Entry Page - Theme configuration for entry pages.
- Theme
Fonts - Theme font configuration.
- Theme
Footer - Theme footer configuration.
- Theme
Header - Theme header configuration.
- Theme
Layout - Theme layout configuration.
- TocEntry
- Table of contents entry.
Functions§
- generate_
html - Generates a complete HTML page for SSG.