@@ -191,6 +191,17 @@ function getSelfLink(links)
191191 return false ;
192192}
193193
194+ function getLinks ( data )
195+ {
196+ if ( data . links )
197+ return data . links ;
198+
199+ if ( data . href )
200+ return [ data ] ;
201+
202+ return [ ] ;
203+ }
204+
194205function renameSummaryKeyInNavigation ( feed )
195206{
196207 if ( feed . navigation )
@@ -236,7 +247,7 @@ function convertPublicationsToFile(feed, path, mainPath, currentUrl)
236247 for ( let i = 0 , len = feed . groups . length ; i < len ; i ++ )
237248 {
238249 const group = feed . groups [ i ] ;
239- const self = getSelfLink ( group . links ?? [ ] ) ;
250+ const self = getSelfLink ( getLinks ( group ) ) ;
240251
241252 if ( self )
242253 {
@@ -250,6 +261,9 @@ function convertPublicationsToFile(feed, path, mainPath, currentUrl)
250261
251262 if ( group . publications )
252263 feed . groups [ i ] = convertPublicationsToFile ( group , path , mainPath , currentUrl ) ;
264+
265+ if ( group . navigation )
266+ feed . groups [ i ] = parseUrls ( group , path , mainPath , currentUrl ) ;
253267 }
254268 }
255269
@@ -443,9 +457,11 @@ function parseUrls(feed, path, mainPath, currentUrl)
443457
444458 if ( facet )
445459 {
446- for ( let j = 0 , len2 = facet . links . length ; j < len2 ; j ++ )
460+ const links = getLinks ( facet ) ;
461+
462+ for ( let j = 0 , len2 = links . length ; j < len2 ; j ++ )
447463 {
448- const link = facet . links [ j ] ;
464+ const link = links [ j ] ;
449465 const rel = getRel ( link . rel ) ;
450466 const _base64 = base64 ( resolveUrl ( currentUrl , link . href ) ) ;
451467
@@ -514,9 +530,11 @@ function base64ToUrl(path)
514530
515531function getPath ( item , currentUrl , mainPath )
516532{
517- for ( let j = 0 , len2 = item . links ?. length ; j < len2 ; j ++ )
533+ const links = getLinks ( item ) ;
534+
535+ for ( let j = 0 , len2 = links ?. length ; j < len2 ; j ++ )
518536 {
519- const link = item . links [ j ] ;
537+ const link = links [ j ] ;
520538
521539 if ( isOpdsCatalog ( link . type ) )
522540 {
0 commit comments