pub fn get_template_for_path<G: Html>(
    raw_path: &str,
    render_cfg: &HashMap<String, String>,
    templates: &TemplateMap<G>
) -> (Option<Rc<Template<G>>>, bool)
Expand description

Determines the template to use for the given path by checking against the render configuration., also returning whether we matched a simple page or an incrementally-generated one (true for incrementally generated). Note that simple pages include those on incrementally-generated templates that we pre-rendered with build paths at build-time (and are hence in an immutable store rather than a mutable store).

This houses the central routing algorithm of Perseus, which is based fully on the fact that we know about every single page except those rendered with ISR, and we can infer about them based on template root path domains. If that domain system is violated, this routing algorithm will not behave as expected whatsoever (as far as routing goes, it’s undefined behavior)!