Struct futhorc::write::Writer [−][src]
pub struct Writer<'a> { pub posts_template: &'a Template, pub index_template: &'a Template, pub index_base_url: &'a Url, pub index_output_directory: &'a Path, pub index_page_size: usize, pub home_page: &'a Url, pub static_url: &'a Url, }
Responsible for indexing, templating, and writing HTML pages to disk from
Post
sources.
Fields
posts_template: &'a Template
The template for post pages.
index_template: &'a Template
The template for index pages.
index_base_url: &'a Url
The base URL for index pages. The main index pages will be located at
{index_base_url}/index.html
, {index_base_url/1.html}
, etc. The tag
index pages will be located at {index_base_url}/{tag_name}/index.html
,
{index_base_url}/{tag_name}/1.html
, etc.
index_output_directory: &'a Path
The directory in which the index HTML files will be written. The main
index page files will be located at
{index_output_directory}/index.html
, {index_output_directory}/1.html
,
etc. The tag index page files will be located at
{index_output_directory}/{tag_name}/index.html
,
{index_output_directory}/{tag_name}/1.html
,
index_page_size: usize
The number of posts per index page.
home_page: &'a Url
The URL for the site’s home page. This is made available to both post and index templates, typically as the destination for the site-header link.
static_url: &'a Url
The URL for the static assets. This is made available to both post and index templates, typically for the theme’s stylesheet.
Implementations
impl Writer<'_>
[src]
pub fn write_posts(&self, posts: &[Post]) -> Result<(), Error>
[src]
Takes a slice of Post
, indexes it by tag, and writes post and index
pages to disk.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Writer<'a>
impl<'a> Send for Writer<'a>
impl<'a> Sync for Writer<'a>
impl<'a> Unpin for Writer<'a>
impl<'a> UnwindSafe for Writer<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,