Expand description
Sitemap Gen
A Rust library for efficient generation and optimization of sitemaps.
§Install
cargo add sitemap-genOr add to Cargo.toml:
[dependencies]
sitemap-gen = "0.0.7"You need Rust 1.56.0 or later. Works on macOS, Linux, and Windows.
§Overview
Sitemap Gen generates and optimises XML sitemaps for search engine indexing.
- Standard sitemaps from URL lists
- Sitemap index for large sites
- News, image, and video sitemap extensions
- Compression for optimised delivery
§Features
| Sitemap generation | Generate XML sitemaps from URL lists |
| Multiple formats | Standard sitemap, sitemap index, news, image, and video |
| Optimisation | Compress and optimise sitemaps for search engines |
| Validation | Validate URLs and sitemap structure |
| CLI | Command-line interface for batch generation |
§Usage
use sitemap_gen::{ChangeFreq, SiteMapData, Sitemap};
use url::Url;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut sitemap = Sitemap::new();
sitemap.add_entry(SiteMapData {
loc: Url::parse("https://example.com/")?,
lastmod: "2026-06-21".to_string(),
changefreq: ChangeFreq::Weekly,
})?;
let xml = sitemap.to_xml()?;
println!("{}", xml);
Ok(())
}§Development
cargo build # Build the project
cargo test # Run all tests
cargo clippy # Lint with Clippy
cargo fmt # Format with rustfmtSee CONTRIBUTING.md for setup, signed commits, and PR guidelines.
THE ARCHITECT ᴫ Sebastien Rousseau THE ENGINE ᵞ EUXIS ᴫ Enterprise Unified Execution Intelligence System
§License
Dual-licensed under Apache 2.0 or MIT, at your option.
A Rust library for generating and managing sitemaps.This crate provides functionality to create, modify, and serialize XML sitemaps according to the Sitemaps XML format. It includes support for handling various sitemap-specific data types and error conditions.
Re-exports§
pub use error::SitemapError;pub use sitemap::convert_date_format;pub use sitemap::create_site_map_data;pub use sitemap::ChangeFreq;pub use sitemap::SiteMapData;pub use sitemap::Sitemap;
Modules§
- error
- Contains error types specific to sitemap operations.
- prelude
- A prelude module for convenient importing of commonly used items.
- sitemap
- Provides the core functionality for creating and managing sitemaps.
- utils
- Utility functions and helper methods for sitemap operations.
Type Aliases§
- Sitemap
Result - Result type alias for sitemap operations.