1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-01 05:21:43 +02:00

feat: not found topics

This commit is contained in:
Arik Chakma
2025-08-22 10:38:23 +06:00
parent 12ae7de3c5
commit 1c80f22a54

View File

@@ -67,16 +67,15 @@ if (isTopic) {
nodeId,
});
if (!topic) {
Astro.response.status = 404;
Astro.response.statusText = 'Not found';
return Astro.rewrite('/404');
if (topic) {
const md = MarkdownIt();
htmlContent = await md.renderAsync(
prepareOfficialRoadmapTopicContent(topic),
);
} else {
htmlContent = '<h1>Not found</h1>';
}
const md = MarkdownIt();
htmlContent = await md.renderAsync(prepareOfficialRoadmapTopicContent(topic));
const fileWithoutBasePath = contentPath.replace(
/.+?\/src\/data/,
'/src/data',