Skip to content

Commit

Permalink
use runfiles to determine more locations instead of relying on the wd
Browse files Browse the repository at this point in the history
  • Loading branch information
DolceTriade committed Jan 10, 2024
1 parent 4ddca8e commit aec2515
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions blade/components/accordion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ where
if hide.get() { "max-h-0 absolute opacity-0 overflow-hidden" } else { "" },
)
}>
<div class="p-5 border border-b-0 border-gray-200">
{children()}
</div>
<div class="p-5 border border-b-0 border-gray-200">{children()}</div>
</div>
}
}
Expand Down
6 changes: 4 additions & 2 deletions blade/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ cfg_if! {
// when not using cargo-leptos None must be replaced with Some("Cargo.toml")
let r = Runfiles::create().expect("Must run using bazel with runfiles");
let leptos_toml = r.rlocation("_main/blade/leptos.toml");
let assets = r.rlocation("_main/blade/static");
let pkg = r.rlocation("_main/blade");
let mut conf = get_configuration(Some(leptos_toml.to_str().unwrap())).await.unwrap();
conf.leptos_options.site_addr = args.http_host;
let addr = conf.leptos_options.site_addr;
Expand All @@ -74,9 +76,9 @@ cfg_if! {
App::new()
.route("/api/{tail:.*}", leptos_actix::handle_server_fns_with_context(move|| provide_context(fn_state.clone())))
// serve JS/WASM/CSS from `pkg`
.service(Files::new("/pkg", site_root))
.service(Files::new("/pkg", pkg.clone()))
// serve other assets from the `assets` directory
.service(Files::new("/assets", format!("{site_root}/static")))
.service(Files::new("/assets", assets.clone()))
// serve the favicon from /favicon.ico
.service(favicon)
.leptos_routes_with_context(
Expand Down
4 changes: 1 addition & 3 deletions blade/routes/empty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ pub fn Empty() -> impl IntoView {
</g>
</svg>
</div>
<p class="font-normal text-3xl text-gray-500">
Missing Invocation ID
</p>
<p class="font-normal text-3xl text-gray-500">Missing Invocation ID</p>
</div>
}
}

0 comments on commit aec2515

Please sign in to comment.