Switch over to WebAssembly, Rust and Yew #35

Merged
BlakeRain merged 87 commits from yew-static into main 2023-08-30 18:01:40 +00:00
Showing only changes of commit ecb26848a3 - Show all commits

View File

@ -43,6 +43,14 @@ impl Template {
} }
async fn render(&self, head: String, body: String) -> String { async fn render(&self, head: String, body: String) -> String {
if head.is_empty() {
eprintln!("warning: empty <head>");
}
if body.is_empty() {
eprintln!("warning: empty <body>");
}
let mut result = String::with_capacity(self.content.len()); let mut result = String::with_capacity(self.content.len());
result.push_str(&self.content[..self.head_index]); result.push_str(&self.content[..self.head_index]);
result.push_str(&head); result.push_str(&head);