File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 11const { join, resolve } = require ( 'node:path' ) ;
2+ const { parse } = require ( 'node:url' ) ;
23
34const clsx = require ( 'clsx' ) ;
45const { createApiPageMD, createInfoPageMD } = require ( 'docusaurus-plugin-openapi-docs/lib/markdown' ) ;
@@ -282,6 +283,7 @@ module.exports = {
282283 '@signalwire/docusaurus-plugin-llms-txt' ,
283284 /** @type {import('@signalwire/docusaurus-plugin-llms-txt').PluginOptions } */
284285 ( {
286+ siteDescription : 'The entire content of Apify documentation is available in a single Markdown file at https://docs.apify.com/llms-full.txt' ,
285287 content : {
286288 includeVersionedDocs : false ,
287289 enableLlmsFullTxt : true ,
@@ -292,9 +294,13 @@ module.exports = {
292294 remarkStringify : {
293295 handlers : {
294296 link : ( node ) => {
295- const isUrlInternal = isInternal ( node . url ) ;
296- const url = isUrlInternal ? `${ config . absoluteUrl } ${ node . url } ` : node . url ;
297+ if ( node . title ?. startsWith ( 'Direct link to' ) ) return '' ;
297298
299+ const parsedUrl = parse ( node . url ) ;
300+ const isUrlInternal = isInternal ( parsedUrl , config . absoluteUrl ) ;
301+ const url = isUrlInternal ? `${ config . absoluteUrl } ${ parsedUrl . pathname } .md` : node . url ;
302+
303+ if ( isUrlInternal && ! parsedUrl . pathname ) return '' ;
298304 if ( node . title ) return `[${ node . title } ](${ url } )` ;
299305 return url ;
300306 } ,
Original file line number Diff line number Diff line change @@ -2,16 +2,13 @@ const { parse } = require('node:url');
22
33const visit = import ( 'unist-util-visit' ) . then ( ( m ) => m . visit ) ;
44
5- const internalUrls = [ 'sdk .apify.com'] ;
5+ const internalUrl = 'docs .apify.com';
66
77/**
88 * @param {import('url').UrlWithStringQuery } href
99 */
10- exports . isInternal = ( href ) => {
11- return internalUrls . some (
12- ( internalUrl ) => href . host === internalUrl
13- || ( ! href . protocol && ! href . host && ( href . pathname || href . hash ) ) ,
14- ) ;
10+ exports . isInternal = ( href , hostName ) => {
11+ return href . host === hostName || ( ! href . protocol && ! href . host && ( href . pathname || href . hash ) ) ;
1512} ;
1613
1714/**
@@ -27,7 +24,7 @@ exports.externalLinkProcessor = () => {
2724 ) {
2825 const href = parse ( node . properties . href ) ;
2926
30- if ( ! exports . isInternal ( href ) ) {
27+ if ( ! exports . isInternal ( href , internalUrl ) ) {
3128 node . properties . target = '_blank' ;
3229 node . properties . rel = 'noopener' ;
3330 } else {
You can’t perform that action at this time.
0 commit comments