Skip to content

Commit

Permalink
fix(nx-dev): include section slug in ai source links
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Aug 19, 2023
1 parent 7d4e2fe commit 9e93b9b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions nx-dev/data-access-ai/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ export function getListOfSources(
}
return false;
})
.map((section) => ({
heading: section.heading ?? section.url_partial,
url: `https://nx.dev${section.url_partial}`,
}));
.map((section) => {
const url = new URL('https://nx.dev');
url.pathname = section.url_partial as string;
if (section.slug) {
url.hash = section.slug;
}
return {
heading: section.heading,
url: url.toString(),
};
});

return result;
}
Expand Down

0 comments on commit 9e93b9b

Please sign in to comment.