pub struct Mdblog { /* private fields */ }
Expand description
blog object
Implementations
sourceimpl Mdblog
impl Mdblog
sourcepub fn load_customize_settings(&mut self) -> Result<()>
pub fn load_customize_settings(&mut self) -> Result<()>
load blog customize settings.
layered configuration system:
- default settings
config.toml
BLOG_
prefix environment variable
sourcepub fn load_posts(&mut self) -> Result<()>
pub fn load_posts(&mut self) -> Result<()>
load blog posts.
sourcepub fn serve(&mut self, port: u16) -> Result<()>
pub fn serve(&mut self, port: u16) -> Result<()>
serve the blog static files in the build_dir
directory.
sourcepub fn build_root_dir(&self) -> Result<PathBuf>
pub fn build_root_dir(&self) -> Result<PathBuf>
blog build directory absolute path.
sourcepub fn theme_root_dir(&self) -> Result<PathBuf>
pub fn theme_root_dir(&self) -> Result<PathBuf>
blog theme root directory absolute path.
sourcepub fn media_root_dir(&self) -> Result<PathBuf>
pub fn media_root_dir(&self) -> Result<PathBuf>
blog media root directory absolute path.
sourcepub fn post_root_dir(&self) -> Result<PathBuf>
pub fn post_root_dir(&self) -> Result<PathBuf>
blog posts root directory.
sourcepub fn ignore_patterns(&self) -> Result<Vec<Pattern>>
pub fn ignore_patterns(&self) -> Result<Vec<Pattern>>
blog glob ignore patterns.
the patterns are used when :
mdblog new
command, the post path is checkedmdblog serve
command, the modified file path is checked
sourcepub fn create_post(&self, path: &Path, tags: &[String]) -> Result<()>
pub fn create_post(&self, path: &Path, tags: &[String]) -> Result<()>
create a new sample post.
sourcepub fn export_config(&self) -> Result<()>
pub fn export_config(&self) -> Result<()>
export blog config.toml file.
sourcepub fn export_media(&self) -> Result<()>
pub fn export_media(&self) -> Result<()>
export blog media files.
sourcepub fn export_static(&self) -> Result<()>
pub fn export_static(&self) -> Result<()>
export blog static files.
sourcepub fn export_posts(&self) -> Result<()>
pub fn export_posts(&self) -> Result<()>
export blog posts.
sourcepub fn export_index(&self) -> Result<()>
pub fn export_index(&self) -> Result<()>
export blog index page.
sourcepub fn export_tag(&self, tag: &Tag) -> Result<()>
pub fn export_tag(&self, tag: &Tag) -> Result<()>
export blog tag index page.
sourcepub fn export_atom(&self) -> Result<()>
pub fn export_atom(&self) -> Result<()>
export blog atom.xml
sourcepub fn render_post(&self, post: &Post) -> Result<String>
pub fn render_post(&self, post: &Post) -> Result<String>
render blog post html.
sourcepub fn render_index(
&self,
posts: &[&Rc<Post>],
prev_name: &str,
next_name: &str
) -> Result<String>
pub fn render_index(
&self,
posts: &[&Rc<Post>],
prev_name: &str,
next_name: &str
) -> Result<String>
render index page html.
sourcepub fn render_tag(
&self,
title: &str,
posts: &[Rc<Post>],
prev_name: &str,
next_name: &str
) -> Result<String>
pub fn render_tag(
&self,
title: &str,
posts: &[Rc<Post>],
prev_name: &str,
next_name: &str
) -> Result<String>
render tag pages html.
sourcepub fn list_blog_theme(&self) -> Result<()>
pub fn list_blog_theme(&self) -> Result<()>
list blog themes.
sourcepub fn create_blog_theme(&self, name: &str) -> Result<()>
pub fn create_blog_theme(&self, name: &str) -> Result<()>
create a new blog theme as same as the current blog theme.
sourcepub fn delete_blog_theme(&self, name: &str) -> Result<()>
pub fn delete_blog_theme(&self, name: &str) -> Result<()>
delete a blog theme.
sourcepub fn set_blog_theme(&mut self, name: &str) -> Result<()>
pub fn set_blog_theme(&mut self, name: &str) -> Result<()>
set blog theme.
Auto Trait Implementations
impl !RefUnwindSafe for Mdblog
impl !Send for Mdblog
impl !Sync for Mdblog
impl Unpin for Mdblog
impl !UnwindSafe for Mdblog
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.