Skip to content

Commit

Permalink
fix: fixed incremental generation on index template
Browse files Browse the repository at this point in the history
Solved by adding an additional case to the routing algorithm before its
termination. This does not have automated tests yet.

Fixes #262.
  • Loading branch information
arctic-hen7 committed Feb 26, 2023
1 parent 1e3206c commit b3b3b82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/perseus/src/router/match_route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ fn get_template_for_path<'a, G: Html>(
}
}
}
// If we still have nothing, then the page doesn't exist
// If we still have nothing, then the page doesn't exist, *unless* there's
// incremental generation on the index template, in which case it does
// (this doesn't break priorities because, above, we go for the most specific,
// and this is the least, meaning there is nothing more specific)
if let Some(entity_name) = entity_name {
(entities.get(&entity_name), was_incremental_match)
} else if render_cfg.contains_key("/*") {
(entities.get(""), true)
} else {
(None, was_incremental_match)
}
Expand Down

0 comments on commit b3b3b82

Please sign in to comment.