Struct futhorc::config::Config [−][src]
pub struct Config { pub posts_source_directory: PathBuf, pub home_page: UrlBuf, pub index_url: UrlBuf, pub index_template: Vec<PathBuf>, pub index_output_directory: PathBuf, pub index_page_size: usize, pub posts_url: UrlBuf, pub posts_template: Vec<PathBuf>, pub posts_output_directory: PathBuf, pub static_url: UrlBuf, pub static_source_directory: PathBuf, pub static_output_directory: PathBuf, }
The complete configuration object, ready to be passed to
crate::build::build_site
.
Fields
posts_source_directory: PathBuf
The absolute path to the directory in which the post source files (.md
)
are located.
home_page: UrlBuf
The fully-qualified URL to the site’s home page. This comes from the
futhorc.yaml
project file and is intended to be provided to the index
and post templates, e.g., to create a site-header link.
index_url: UrlBuf
The fully-qualified base URL for the index pages. The main index pages
will live at {index_url}/index.html
, {index_url}/1.html
, etc. The tag
index pages will live at {index_url}/{tag_name}/index.html
,
{index_url}/{tag_name}/1.html
, etc.
index_template: Vec<PathBuf>
The paths to index template files which will be concatenated and the result
parsed into a gtmpl::Template
object.
index_output_directory: PathBuf
The absolute path to the output directory for index files. The main index
page files will live at {index_output_directory}/index.html
,
{index_output_directory}/1.html
, etc. The tag index page files will
live at {index_output_directory}/{tag_name}/index.html
,
{index_output_directory}/{tag_name}/1.html
, etc.
index_page_size: usize
The number of posts per index page. Defaults to 10.
posts_url: UrlBuf
The fully-qualified base URL for post pages. E.g., for a post whose
source file is located at {posts_source_directory}/foo/bar.md
, the URL
will be {posts_url}/foo/bar.html
.
posts_template: Vec<PathBuf>
The paths to post template files which will be concatenated and the result
parsed into a gtmpl::Template
object.
posts_output_directory: PathBuf
The fully-qualified base URL for post pages. E.g., for a post whose
source file is located at {posts_source_directory}/foo/bar.md
, the URL
will be {posts_url}/foo/bar.html
.
static_url: UrlBuf
The fully-qualified base URL for static assets. E.g., a static asset
whose source file is located at {static_source_directory}/style.css
will have the URL, {static_url}/style.css
.
static_source_directory: PathBuf
The absolute path to the source directory for static assets.
static_output_directory: PathBuf
The absolute path to the output directory for static assets.
Implementations
impl Config
[src]
pub fn from_directory(
dir: &Path,
output_directory: &Path
) -> Result<Config, Error>
[src]
dir: &Path,
output_directory: &Path
) -> Result<Config, Error>
Loads a Config
object from source and output directory parameters.
pub fn from_project_file(
path: &Path,
output_directory: &Path
) -> Result<Config, Error>
[src]
path: &Path,
output_directory: &Path
) -> Result<Config, Error>
Loads a Config
object from project file path and output directory
path parameters.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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>,