expose static site generation in the launch builder and prelude

This commit is contained in:
Evan Almloff 2024-07-10 16:59:08 -07:00
parent 580bf666a6
commit 742721bfde
3 changed files with 26 additions and 0 deletions

View file

@ -94,6 +94,20 @@ impl LaunchBuilder {
}
}
/// Launch your static site generation application.
#[cfg(feature = "static-generation")]
#[cfg_attr(docsrs, doc(cfg(feature = "static-generation")))]
pub fn static_generation() -> LaunchBuilder<dioxus_static_site_generation::Config, SendContext>
{
LaunchBuilder {
launch_fn: |root, contexts, cfg| {
dioxus_static_site_generation::launch::launch(root, contexts, cfg)
},
contexts: Vec::new(),
platform_config: None,
}
}
/// Launch your fullstack application.
#[cfg(feature = "mobile")]
#[cfg_attr(docsrs, doc(cfg(feature = "mobile")))]

View file

@ -104,6 +104,13 @@ pub mod prelude {
#[cfg_attr(docsrs, doc(cfg(feature = "fullstack")))]
pub use dioxus_fullstack::prelude::*;
#[cfg(all(feature = "static-generation", not(feature = "fullstack")))]
#[cfg_attr(
docsrs,
doc(cfg(all(feature = "static-generation", not(feature = "fullstack"))))
)]
pub use dioxus_static_site_generation::prelude::*;
#[cfg(feature = "router")]
#[cfg_attr(docsrs, doc(cfg(feature = "router")))]
pub use dioxus_router;

View file

@ -6,3 +6,8 @@ pub mod launch;
#[cfg(feature = "server")]
pub(crate) mod ssg;
/// A prelude of commonly used items in static generation apps.
pub mod prelude {
pub use dioxus_fullstack::prelude::*;
}