Filter eleventy endpoints by route, not payload

This commit is contained in:
Sam Carlton 2021-05-08 16:48:08 -05:00
parent 44fa023a06
commit 37a296adfe
4 changed files with 16 additions and 16 deletions

View file

@ -56,4 +56,10 @@ export function getVideoEndpoint ( video ) {
return `/tv/${video.slug}`
}
export function getRouteType ( routeString ) {
// Remove first slash and split by remaining
// slashes to get first part of route
const [ routeType ] = routeString.substring(1).split('/')
return routeType
}