- set index on 404 to true (highly desired for SPA)
- add support for web.base_path in dioxus.toml to allow multi level routes
This commit is contained in:
1 parent
e84851bdfb
commit
280480de6b
3 files changed
+36
-25
No files matched your search
+9
-3
@@ -82,20 +82,21 @@ pub fn build(config: &CrateConfig) -> Result<()> {
|
||||
|
||||
bindgen_builder
|
||||
.input_path(input_path)
|
||||
.web(true).unwrap()
|
||||
.web(true)
|
||||
.unwrap()
|
||||
.debug(true)
|
||||
.demangle(true)
|
||||
.keep_debug(true)
|
||||
.remove_name_section(false)
|
||||
.remove_producers_section(false)
|
||||
.out_name(&dioxus_config.application.name)
|
||||
.generate(&bindgen_outdir).unwrap();
|
||||
.generate(&bindgen_outdir)
|
||||
.unwrap();
|
||||
});
|
||||
if bindgen_result.is_err() {
|
||||
log::error!("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate.");
|
||||
}
|
||||
|
||||
|
||||
// this code will copy all public file to the output dir
|
||||
let copy_options = fs_extra::dir::CopyOptions {
|
||||
overwrite: true,
|
||||
@@ -278,6 +279,11 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String {
|
||||
|
||||
html = html.replace("{app_name}", &config.application.name);
|
||||
|
||||
html = match &config.web.app.base_path {
|
||||
Some(path) => html.replace("{base_path}", path),
|
||||
None => html.replace("{base_path}", "."),
|
||||
};
|
||||
|
||||
let title = config
|
||||
.web
|
||||
.app
|
||||
|
||||
Reference in new issue
Block a user