✨ Añade soporte para recursos en documentos HTML
- Incluye los recursos favicon, hojas de estilo y scripts JavaScript. - Se introduce una estructura de contexto que, además de gestionar el idioma y el uso de parámetros contextuales, permite administrar estos recursos en documentos HTML.
This commit is contained in:
parent
3ed94457fa
commit
7292f3d225
10 changed files with 903 additions and 7 deletions
17
tests/html.rs
Normal file
17
tests/html.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
#[pagetop::test]
|
||||
async fn prepare_markup_is_empty() {
|
||||
let _app = service::test::init_service(Application::new().test()).await;
|
||||
|
||||
assert!(PrepareMarkup::None.is_empty());
|
||||
|
||||
assert!(PrepareMarkup::Text(String::from("")).is_empty());
|
||||
assert!(!PrepareMarkup::Text(String::from("x")).is_empty());
|
||||
|
||||
assert!(PrepareMarkup::Escaped(String::new()).is_empty());
|
||||
assert!(!PrepareMarkup::Escaped("a".into()).is_empty());
|
||||
|
||||
assert!(PrepareMarkup::With(html! {}).is_empty());
|
||||
assert!(!PrepareMarkup::With(html! { span { "!" } }).is_empty());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue