pub struct Config {}
Expand description
Settings for a statically generated site that may be hydrated in the browser
Implementations§
Source§impl Config
impl Config
Sourcepub fn map_path<F: Fn(&str) -> PathBuf + Send + Sync + 'static>(
self,
map_path: F,
) -> Self
pub fn map_path<F: Fn(&str) -> PathBuf + Send + Sync + 'static>( self, map_path: F, ) -> Self
Set a mapping from the route to the file path. This will override the default mapping configured with static_dir
.
The function should return the path to the folder to store the index.html file in.
This method will only effect static site generation.
Sourcepub fn output_dir(self, output_dir: PathBuf) -> Self
pub fn output_dir(self, output_dir: PathBuf) -> Self
Set the output directory for the static site generation. (defaults to ./static) This is the directory that will be used to store the generated static html files.
This method will only effect static site generation.
Sourcepub fn root_id(self, root_id: &'static str) -> Self
pub fn root_id(self, root_id: &'static str) -> Self
Set the id of the root element in the index.html file to place the prerendered content into. (defaults to main)
Sourcepub fn index_html(self, index_html: String) -> Self
pub fn index_html(self, index_html: String) -> Self
Set the contents of the index.html file to be served. (precedence over index_path)
This method will only effect static site generation.
Sourcepub fn index_path(self, index_path: PathBuf) -> Self
pub fn index_path(self, index_path: PathBuf) -> Self
Set the path of the index.html file to be served. (defaults to {assets_path}/index.html)
This method will only effect static site generation.
Sourcepub fn additional_routes(self, routes: Vec<String>) -> Self
pub fn additional_routes(self, routes: Vec<String>) -> Self
Sets a list of static routes that will be pre-rendered and served in addition to the static routes in the router.
Sourcepub fn github_pages(self) -> Self
pub fn github_pages(self) -> Self
A preset for github pages. This will output your files in the /docs
directory and set up a 404.html
file.