Skip to main content

get_entry

Function get_entry 

Source
pub fn get_entry<T: DeserializeOwned>(
    dir: impl AsRef<Path>,
    slug: &str,
) -> Result<Option<Entry<T>>>
Expand description

Loads a single entry from dir whose slug matches slug.

Returns Ok(None) when no Markdown file with that slug exists. Use get_collection when you need every entry or when you don’t know the slug ahead of time.

§Errors

Same as get_collection.