@@ -4,38 +4,50 @@ enum RoutePath {
44	Projects  =  'projects' , 
55	About  =  'about' , 
66	Legal  =  'legal' , 
7- 	NotFound  =  'not-found ' , 
8- 	Other  =  '* ' 
7+ 	NotFound  =  '404 ' , 
8+ 	Rss  =  'rss.xml ' 
99} 
1010
1111const  toPath  =  ( path ?: RoutePath ) : string  =>  { 
1212	if  ( ! path )  { 
1313		return  '/' ; 
1414	} 
1515
16- 	if  ( path  ===  RoutePath . Other )  { 
17- 		return  RoutePath . Other ; 
18- 	} 
19- 
2016	return  `/${ path }  ; 
2117} ; 
2218
2319export  const  homeRoute  =  toPath ( RoutePath . Home ) ; 
2420
2521export  const  blogRoute  =  toPath ( RoutePath . Blog ) ; 
2622
27- export  const  newArticleRoute  =  `${ blogRoute } new ` ; 
23+ export  const  newArticleRoute  =  `${ blogRoute } draft ` ; 
2824
2925export  const  projectsRoute  =  toPath ( RoutePath . Projects ) ; 
3026
3127export  const  aboutRoute  =  toPath ( RoutePath . About ) ; 
3228
3329export  const  legalRoute  =  toPath ( RoutePath . Legal ) ; 
3430
31+ export  const  rssRoute  =  toPath ( RoutePath . Rss ) ; 
32+ 
3533export  const  notFoundRoute  =  toPath ( RoutePath . NotFound ) ; 
3634
3735export  const  toArticle  =  ( id : string ) : string  =>  `${ blogRoute } ${ id }  ; 
3836
3937export  const  getAbsoluteArticleUrl  =  ( host : string ,  slug : string ) : string  =>  `${ host } ${ slug }  ; 
4038
41- export  const  getAbsoluteRssUrl  =  ( host : string ) : string  =>  `${ host }  ; 
39+ export  const  getAbsoluteRssUrl  =  ( host : string ) : string  =>  `${ host } ${ rssRoute }  ; 
40+ 
41+ export  interface  RoutePriority  { 
42+ 	critical : string [ ] ; 
43+ 	major : string [ ] ; 
44+ 	minor : string [ ] ; 
45+ } 
46+ 
47+ export  const  getRoutes  =  ( host : string ,  slugs : string [ ] ) : RoutePriority  =>  { 
48+ 	return  { 
49+ 		critical : slugs . map ( slug  =>  `${ blogRoute } ${ slug }  ) , 
50+ 		major : [ homeRoute ,  blogRoute ,  projectsRoute ,  aboutRoute ] , 
51+ 		minor : [ legalRoute ,  notFoundRoute ] 
52+ 	} ; 
53+ } ; 
0 commit comments