Skip to content

Commit c8d86c7

Browse files
committed
refactor(llms-txt): remove docs url suffix
1 parent ee63084 commit c8d86c7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/constants.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export const DOC_NODE_VERSION = process.version;
77
export const DOC_NODE_CHANGELOG_URL =
88
'https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md';
99

10-
// The base URL for the latest Node.js documentation
11-
export const LATEST_DOC_API_BASE_URL = 'https://nodejs.org/docs/latest/';
10+
// The base URL for the Node.js website
11+
export const BASE_URL = 'https://nodejs.org/';

src/generators/llms-txt/utils/buildApiDocLink.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ const getEntryDescription = entry => {
3838
export const buildApiDocLink = entry => {
3939
const title = entry.heading.data.name;
4040

41-
// Remove the leading doc/ from the path
42-
const path = entry.api_doc_source.replace(/^doc\//, '');
41+
const path = entry.api_doc_source.replace(/^doc\//, '/docs/latest/');
4342
const url = new URL(path, LATEST_DOC_API_BASE_URL);
4443

4544
const link = `[${title}](${url})`;

0 commit comments

Comments
 (0)