Skip to content

Commit

Permalink
last path issues please
Browse files Browse the repository at this point in the history
  • Loading branch information
Zheoni committed Jan 13, 2024
1 parent 0f57173 commit 76f77d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/serve/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ fn recipe_entry_context(
.images()
.iter()
.find(|i| i.indexes.is_none())
.map(|i| format!("/src/{}", i.path));
.map(|i| format!("/src/{}", clean_path(&i.path, &state.base_path)));
}

let path = r.path().with_extension("");
let path = clean_path(r.path(), &state.base_path).with_extension("");

Some(context! {
fallback_name => r.name(),
Expand Down
2 changes: 1 addition & 1 deletion src/serve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fn make_router(state: Arc<AppState>) -> Router {
ServiceBuilder::new()
.layer(middleware::from_fn(filter_files))
.layer(middleware::from_fn(cook_mime_type))
.service(tower_http::services::ServeDir::new(".")),
.service(tower_http::services::ServeDir::new(&state.base_path)),
)
.fallback(handlers::static_file)
.with_state(state)
Expand Down

0 comments on commit 76f77d3

Please sign in to comment.