File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ const { collectSlugs } = require('./tools/utils/collectSlugs');
99const { externalLinkProcessor, isInternal } = require ( './tools/utils/externalLink' ) ;
1010const { removeLlmButtons } = require ( './tools/utils/removeLlmButtons' ) ;
1111
12+ /**
13+ * Helper to extract text from a node recursively.
14+ */
15+ function getNodeText ( node ) {
16+ if ( node . type === 'text' || node . type === 'code' || node . type === 'inlineCode' ) return node . value || '' ;
17+ if ( node . children ) return node . children . map ( getNodeText ) . join ( '' ) ;
18+ return '' ;
19+ }
20+
1221/** @type {Partial<import('@docusaurus/types').DocusaurusConfig> } */
1322module . exports = {
1423 title : 'Apify Documentation' ,
@@ -301,7 +310,10 @@ module.exports = {
301310 const url = isUrlInternal ? `${ config . absoluteUrl } ${ parsedUrl . pathname } .md` : node . url ;
302311
303312 if ( isUrlInternal && ! parsedUrl . pathname ) return '' ;
313+
304314 if ( node . title ) return `[${ node . title } ](${ url } )` ;
315+ const linkText = getNodeText ( node ) ;
316+ if ( linkText ) return `[${ linkText } ](${ url } )` ;
305317 return url ;
306318 } ,
307319 code : ( node ) => {
You can’t perform that action at this time.
0 commit comments