-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ props now passed around as strings
This only adds one extra deserialization at build-time and removes the need for heap allocation
- Loading branch information
1 parent
734f9df
commit 7a334cf
Showing
14 changed files
with
239 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
use perseus::{ | ||
config_manager::{FsConfigManager, ConfigManager}, | ||
build_templates | ||
config_manager::FsConfigManager, | ||
build::build_templates | ||
}; | ||
use perseus_showcase_app::pages; | ||
use sycamore::prelude::SsrNode; | ||
|
||
fn main() { | ||
let config_manager = FsConfigManager::new(); | ||
|
||
build_templates!([ | ||
build_templates(vec![ | ||
pages::index::get_page::<SsrNode>(), | ||
pages::about::get_page::<SsrNode>(), | ||
pages::post::get_page::<SsrNode>() | ||
], &config_manager); | ||
], &config_manager).expect("Static generation failed!"); | ||
|
||
println!("Static generation successfully completed!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
pub mod index; | ||
pub mod about; | ||
pub mod post; | ||
|
||
use perseus::{get_templates_map, template::Template}; | ||
use sycamore::prelude::GenericNode; | ||
use std::collections::HashMap; | ||
|
||
/// Shorthand for the `get_templates_map!` macro from Perseus for our specific app pages. | ||
pub fn get_templates_map<G: GenericNode>() -> HashMap<String, Template<G>> { | ||
get_templates_map! [ | ||
index::get_page::<G>(), | ||
about::get_page::<G>(), | ||
post::get_page::<G>() | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.