Module medium

Source
Expand description

medium refers to medium RAM usage - use this module when your blog is quite large, but you can fit an index in memory. You will need to render the render each blog every time you wish to display it

lazy_static! {
    pub static ref STATIC_BLOG_ENTRIES: MediumBlog =
        get_medium_blog(PathBuf::from(BLOG_ROOT), None, None, URL, &SitemapOptions::Default());
    }

let this_blog = match all_blogs.hash.get(&complete_slug) {
    Some(x) => x,
    None => return None,
};

context.insert(
    "blog",
    &this_blog
        .render(PathBuf::from_str(BLOG_ROOT).unwrap())
        .unwrap(),
);

Structs§

MediumBlog
The main MediumBlog which stores all relevant information for the blog
MediumBlogEntry
An individual blog post. You will need to render this using render

Functions§

get_medium_blog
Gets the whole MediumBlog from the specified path. Useful to combine with lazy static for loading times