Expand description
§leptos-next-metadata
Next.js-style metadata management for Leptos applications with type-safe APIs, blazing-fast OG image generation, and comprehensive SEO optimization.
§Quick Example
use leptos_next_metadata::prelude::*;
// Create metadata for a page
let metadata = Metadata {
title: Some(Title::Static("My Page".into())),
description: Some("Page description".into()),
..Default::default()
};
// Use in your Leptos component§Features
- 🚀 2-7x faster OG image generation than browser-based solutions
- 🦀 Type-safe metadata with compile-time validation
- 🎯 Next.js compatible API for easy migration
- 🖼️ Dynamic OG images with SVG templates and custom fonts
- 📊 JSON-LD support with Schema.org types
- 🔍 SEO validation with best practices enforcement
- ⚡ SSR/CSR/Islands - works with all Leptos rendering modes
- 📁 File conventions - automatic favicon, robots.txt, sitemap detection
- 🎨 Template system - Liquid templates for OG images
- 💾 Smart caching - multi-level caching for optimal performance
§Feature Flags
ssr- Server-side rendering support (default)csr- Client-side rendering supporthydrate- Hydration supportog-images- Open Graph image generation (default)file-conventions- File-based metadata conventions (default)json-ld- JSON-LD structured data supportcaching- Advanced caching with LRU and TTLhttp- HTTP client for external metadata fetchingdebug- Debug logging and validation
§Modules
- [
metadata] - Core metadata types and traits og_image- Open Graph image generationjson_ld- JSON-LD structured dataconventions- File convention scanningmacros- Procedural macros for metadatautils- Utility functions and helpers
Re-exports§
pub use body::Body;pub use conventions::ConventionScanner;pub use conventions::FileConventions;pub use enhanced_title::EnhancedTitle;pub use html::Html;pub use json_ld::Answer;pub use json_ld::Article;pub use json_ld::BlogPosting;pub use json_ld::BreadcrumbList;pub use json_ld::FAQPage;pub use json_ld::JsonLd;pub use json_ld::ListItem;pub use json_ld::Organization;pub use json_ld::Person;pub use json_ld::Product;pub use json_ld::Question;pub use json_ld::SchemaOrg;pub use json_ld::WebPage;pub use meta_tags::MetaTags;pub use metadata::Authors;pub use metadata::CanonicalUrl;pub use metadata::ColorScheme;pub use metadata::Description;pub use metadata::FormatDetection;pub use metadata::Keywords;pub use metadata::Metadata;pub use metadata::OpenGraph;pub use metadata::ReferrerPolicy;pub use metadata::Robots;pub use metadata::ThemeColor;pub use metadata::Title;pub use metadata::Twitter;pub use metadata::TwitterCard;pub use metadata::Viewport;pub use og_image::GeneratedOgImage;pub use og_image::OgImageGenerator;pub use og_image::OgImageParams;pub use macros::*;
Modules§
- analytics
- Analytics Integration for Metadata Usage Tracking
- api
- API module for contract-first development
- body
- canvas_
types - Advanced Canvas Types
- competitive_
analysis - Competitive Analysis Module
- conventions
- File conventions for leptos-next-metadata
- enhanced_
title - error
- Unified error handling for leptos-next-metadata
- hashed_
stylesheet - html
- json_ld
- JSON-LD structured data for leptos-next-metadata
- macros
- Procedural macros for leptos-next-metadata
- meta_
tags - metadata
- Core metadata types and functionality for leptos-next-metadata
- og_
image - Open Graph image generation for leptos-next-metadata
- prelude
- Re-exports for common use cases
- themes
- Theme Support for OG Images
- utils
- Utility functions and helpers for leptos-next-metadata
Macros§
- time_
operation - Helper macro for timing operations
- track_
operation - Helper macro for tracking operations
Structs§
- Cache
Config - Cache configuration
- Convention
Config - Convention configuration
- Debug
Config - Debug configuration
- Font
Config - Font configuration
- Limit
Config - Resource limits configuration
- Metadata
Config - Configuration for the metadata system
- OgImage
Config - OG image configuration
Enums§
- Error
- Error type for metadata operations
- Font
Weight - Font weight enumeration
- Image
Format - Image format enumeration
Functions§
- Hashed
Stylesheet - A component that injects a hashed stylesheet link into the document head.
Type Aliases§
- Result
- Result type for metadata operations