mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-24 05:03:06 +00:00
feat: add custom html
support
This commit is contained in:
parent
e5dfe84eb1
commit
21697ac99e
1 changed files with 3 additions and 3 deletions
|
@ -277,14 +277,14 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String {
|
||||||
let custom_html_file = crate_root.join("index.html");
|
let custom_html_file = crate_root.join("index.html");
|
||||||
let mut html = if custom_html_file.is_file() {
|
let mut html = if custom_html_file.is_file() {
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
let file = File::open(custom_html_file).unwrap();
|
let mut file = File::open(custom_html_file).unwrap();
|
||||||
if let Ok(v) = file.read_to_string(&mut buf) {
|
if file.read_to_string(&mut buf).is_ok() {
|
||||||
buf
|
buf
|
||||||
} else {
|
} else {
|
||||||
String::from(include_str!("./assets/index.html"))
|
String::from(include_str!("./assets/index.html"))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String::from(include_str!("./assets/index.html"));
|
String::from(include_str!("./assets/index.html"))
|
||||||
};
|
};
|
||||||
|
|
||||||
let resouces = config.web.resource.clone();
|
let resouces = config.web.resource.clone();
|
||||||
|
|
Loading…
Reference in a new issue