fromLocation(route) {
    // trim possible extensions from the location.
    route = route.replace(/\.(html|json)$/, "")
    const routes = {
      category: new Route("/categor(y)(ies)/*slug(/p/:page)"),
      tag: new Route("/tag(s)/:slug(/p/:page)"),
      post: new Route("/post(s)/:year/:month/:slug"),
      page: new Route("/page(s)/:slug"),
      postList: new Route("/(index)(/p/:page)"),
    };
    for (let key in routes) {
      var matched = routes[key].match(route);
      if (matched) {
        matched.name = key;
        return matched;
      }
    }
  }
/* fromLocation(location)
   *
   * Parse the location and return a set of matches.
   */
fromLocation(location)
Parse the location and return a set of matches.
fromLocation ( location ) Parse the location and return a set of matches .
fromLocation(route) {
    route = route.replace(/\.(html|json)$/, "")
    const routes = {
      category: new Route("/categor(y)(ies)/*slug(/p/:page)"),
      tag: new Route("/tag(s)/:slug(/p/:page)"),
      post: new Route("/post(s)/:year/:month/:slug"),
      page: new Route("/page(s)/:slug"),
      postList: new Route("/(index)(/p/:page)"),
    };
    for (let key in routes) {
      var matched = routes[key].match(route);
      if (matched) {
        matched.name = key;
        return matched;
      }
    }
  }
fromLocation ( route ) { route = route . replace ( / \.(html|json)$ / , "" ) const routes = { category : new Route ( "/categor(y)(ies)/*slug(/p/:page)" ) , tag : new Route ( "/tag(s)/:slug(/p/:page)" ) , post : new Route ( "/post(s)/:year/:month/:slug" ) , page : new Route ( "/page(s)/:slug" ) , postList : new Route ( "/(index)(/p/:page)" ) , } ; for ( let key in routes ) { var matched = routes [ key ] . match ( route ) ; if ( matched ) { matched . name = key ; return matched ; } } }
fromLocation(location)
 Parse the location and return a set of matches.
fromLocation ( location ) Parse the location and return a set of matches .
// trim possible extensions from the location.