|
|
|
@ -22,6 +22,7 @@ const topicPath = Array.isArray(topicId) ? topicId.join('/') : topicId; |
|
|
|
|
// Get the project root directory |
|
|
|
|
const __filename = fileURLToPath(import.meta.url); |
|
|
|
|
const __dirname = path.dirname(__filename); |
|
|
|
|
|
|
|
|
|
// hack to make it work. TODO: Fix |
|
|
|
|
const projectRoot = path.resolve(__dirname, '../../..').replace(/dist$/, ''); |
|
|
|
|
|
|
|
|
@ -36,8 +37,6 @@ let contentPath = path.join( |
|
|
|
|
`${topicPath}.md`, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
console.log(contentPath); |
|
|
|
|
|
|
|
|
|
// Check if file exists |
|
|
|
|
if (!fs.existsSync(contentPath)) { |
|
|
|
|
const indexFilePath = path.join( |
|
|
|
|