Correctly build route URLs supporting optional sections