Struct mdblog::Post
[−]
[src]
pub struct Post { pub path: PathBuf, // some fields omitted }
blog post object
every blog post is composed of head
part and body
part.
the two part is separated by the first blank line.
the blog header part supported headers:
- date: the publish datetime, required,
date: 1970-01-01 00:00:00
- tags: the tags of blog post, required,
tags: hello, world
- hidden: whether hidden blog post or not, optional, default
true
,hidden: false
Fields
path: PathBuf
relative path of post from blog root directory
Methods
impl Post
[src]
fn new<P: AsRef<Path>>(root: P, path: P) -> Post
fn src(&self) -> PathBuf
the absolute path of blog post markdown file
fn dest(&self) -> PathBuf
the absolute path of blog post html file
fn title(&self) -> &str
blog title
fn datetime(&self) -> DateTime<Local>
blog publish time
wether blog post is hidden or not
fn url(&self) -> PathBuf
the post url
fn content(&self) -> String
the rendered html content of post body port
the post tags
fn map(&self) -> Map<&str, String>
post context for render
fn load(&mut self) -> Result<()>
load post head part and body part