routeFor function
content/operations/streaming.md -> /operations/streaming.
index.md drops its trailing segment: content/index.md -> /,
content/guides/index.md -> /guides. Mirrors jaspr_content's own
PageSource url derivation, which does the same.
Implementation
String routeFor(String path, String contentPath) {
var relative = path.substring(contentPath.length).replaceAll(r'\', '/');
relative = relative
.replaceFirst(RegExp('^/'), '')
.replaceFirst(RegExp(r'\.md$'), '');
final segments = relative.split('/');
if (segments.last == 'index') segments.removeLast();
if (segments.isEmpty) return '/';
return '/${segments.join('/')}';
}