pub struct BlogRegistry {
pub posts_per_page: usize,
pub date_format: String,
pub theme: Option<ThemeConfig>,
/* private fields */
}Expand description
Central blog registry holding all parsed content.
Created via BlogConfig builder and typically stored in a LazyLock<BlogRegistry> static.
Fields§
§posts_per_page: usizePosts per page for pagination.
date_format: StringDate display format string.
theme: Option<ThemeConfig>Optional theme configuration.
Implementations§
Source§impl BlogRegistry
impl BlogRegistry
pub fn get_post(&self, slug: &str) -> Option<&BlogPost>
pub fn all_posts(&self) -> &[BlogPost]
Sourcepub fn featured_posts(&self) -> Vec<&BlogPost>
pub fn featured_posts(&self) -> Vec<&BlogPost>
Get all featured/pinned posts, sorted by date (newest first).
Sourcepub fn has_featured(&self) -> bool
pub fn has_featured(&self) -> bool
Check if there are any featured posts.
pub fn posts_by_tag(&self, tag: &str) -> Vec<&BlogPost>
Sourcepub fn non_featured_posts_page(&self, page: usize) -> Vec<&BlogPost>
pub fn non_featured_posts_page(&self, page: usize) -> Vec<&BlogPost>
Get a page of non-featured posts for the main blog index.
Sourcepub fn non_featured_total_pages(&self) -> usize
pub fn non_featured_total_pages(&self) -> usize
Total number of pages for the main blog index, excluding featured posts.
Find posts related to the given slug by tag overlap.
Returns up to max posts sorted by number of overlapping tags (descending),
then by date (newest first). Excludes the current post.
pub fn posts_page(&self, page: usize) -> &[BlogPost]
pub fn posts_page_by_tag(&self, tag: &str, page: usize) -> Vec<&BlogPost>
pub fn total_pages(&self) -> usize
pub fn total_pages_for_tag(&self, tag: &str) -> usize
Sourcepub fn prev_post(&self, slug: &str) -> Option<&BlogPost>
pub fn prev_post(&self, slug: &str) -> Option<&BlogPost>
Get the previous post (older) relative to the given slug.
Sourcepub fn next_post(&self, slug: &str) -> Option<&BlogPost>
pub fn next_post(&self, slug: &str) -> Option<&BlogPost>
Get the next post (newer) relative to the given slug.
pub fn tag_count(&self, tag: &str) -> usize
pub fn search_posts(&self, query: &str) -> Vec<&BlogSearchEntry>
pub fn generate_rss( &self, site_title: &str, site_url: &str, blog_path: &str, ) -> String
pub fn generate_llms_txt( &self, site_title: &str, site_description: &str, base_url: &str, blog_path: &str, ) -> String
Sourcepub fn generate_sitemap(&self, site_url: &str, blog_path: &str) -> String
pub fn generate_sitemap(&self, site_url: &str, blog_path: &str) -> String
Generate a sitemap.xml for all blog posts.