diff --git a/packages/akiradocs/compiled/en/articles/_meta.json b/packages/akiradocs/compiled/en/articles/_meta.json index dd4c6fe..24f7566 100644 --- a/packages/akiradocs/compiled/en/articles/_meta.json +++ b/packages/akiradocs/compiled/en/articles/_meta.json @@ -2,7 +2,7 @@ "defaultRoute": "/articles/welcome", "welcome": { "title": "Welcome to Akira Doc", - "path": "/en/articles/welcome" + "path": "/articles/welcome" }, "template": { "title": "Test Blog Post", @@ -10,6 +10,6 @@ }, "ai_integration": { "title": "Ai Integration", - "path": "/en/articles/ai_integration" + "path": "/articles/ai_integration" } } \ No newline at end of file diff --git a/packages/akiradocs/compiled/en/docs/_meta.json b/packages/akiradocs/compiled/en/docs/_meta.json index 2ae58e1..e7a65b1 100644 --- a/packages/akiradocs/compiled/en/docs/_meta.json +++ b/packages/akiradocs/compiled/en/docs/_meta.json @@ -2,7 +2,7 @@ "defaultRoute": "/docs/introduction", "introduction": { "title": "Introduction", - "path": "/en/docs/introduction" + "path": "/docs/introduction" }, "guides": { "title": "Guides", diff --git a/packages/akiradocs/compiled/en/docs/getting-started/_meta.json b/packages/akiradocs/compiled/en/docs/getting-started/_meta.json deleted file mode 100644 index 87e164d..0000000 --- a/packages/akiradocs/compiled/en/docs/getting-started/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "quickstart": { - "title": "Quickstart Guide", - "path": "/en/docs/getting-started/quickstart" - } -} \ No newline at end of file diff --git a/packages/akiradocs/compiled/en/docs/guides/_meta.json b/packages/akiradocs/compiled/en/docs/guides/_meta.json deleted file mode 100644 index 5469288..0000000 --- a/packages/akiradocs/compiled/en/docs/guides/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "analytics": { - "title": "Analytics Integration", - "path": "/en/docs/guides/analytics" - } -} \ No newline at end of file diff --git a/packages/akiradocs/public/context/en_docs.txt b/packages/akiradocs/public/context/en_docs.txt index af80f0e..c52da6a 100644 --- a/packages/akiradocs/public/context/en_docs.txt +++ b/packages/akiradocs/public/context/en_docs.txt @@ -1,3 +1,13 @@ +[Document: docs/introduction.json] +Title: Introduction +Akira Docs is a modern documentation platform that combines the power of AI with an intuitive block-based content system. This guide will help you understand the core concepts and features. +Key Features +AI-powered search +Block-based content editing +Responsive design +Customizable themes +Markdown support +------------- [Document: articles/welcome.json] Title: Welcome to Akira Doc Get started with Akira Docs - Next-gen documentation powered by AI @@ -56,16 +66,6 @@ ai_assistant: Next Steps Explore our [Advanced AI Features](/advanced-ai-features) guide to learn more about specialized use cases and integration possibilities. ------------- -[Document: docs/introduction.json] -Title: Introduction -Akira Docs is a modern documentation platform that combines the power of AI with an intuitive block-based content system. This guide will help you understand the core concepts and features. -Key Features -AI-powered search -Block-based content editing -Responsive design -Customizable themes -Markdown support -------------- [Document: docs/guides/analytics.json] Title: Analytics Integration Learn how to add analytics tracking to your documentation diff --git a/packages/akiradocs/scripts/compile.js b/packages/akiradocs/scripts/compile.js index 3ab70bf..7d79527 100644 --- a/packages/akiradocs/scripts/compile.js +++ b/packages/akiradocs/scripts/compile.js @@ -242,12 +242,15 @@ async function updateMetaFile(folderPath, newFile) { .split('_') .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join(' '); + + const pathWithoutLang = relativePath.split(path.sep).slice(1).join(path.sep); meta[fileName] = { title: compiledContent.title || humanReadableFileName, - path: path.join('/', relativePath, fileName) + path: path.join('/', pathWithoutLang, fileName) }; } else { - meta[fileName].path = path.join('/', relativePath, fileName); + const pathWithoutLang = relativePath.split(path.sep).slice(1).join(path.sep); + meta[fileName].path = path.join('/', pathWithoutLang, fileName); } await writeFile(metaPath, JSON.stringify(meta, null, 2)); @@ -281,7 +284,7 @@ async function compileMarkdownFiles() { await mkdir(path.dirname(compiledPath), { recursive: true }); await writeFile(compiledPath, JSON.stringify(compiledContent, null, 2)); - await updateMetaFile(path.dirname(compiledPath), compiledPath); + // await updateMetaFile(path.dirname(compiledPath), compiledPath); console.log(`Compiled ${file} -> ${compiledPath}`); } @@ -315,7 +318,7 @@ async function createMetaFilesForAllFolders() { const jsonFiles = await glob('**/*.json', { cwd: sectionPath, - ignore: '**/_meta.json' + ignore: ['**/_meta.json'] }); const meta = { @@ -326,7 +329,7 @@ async function createMetaFilesForAllFolders() { const fileName = path.basename(jsonFile, '.json'); const filePath = path.join(sectionPath, jsonFile); const content = JSON.parse(await readFile(filePath, 'utf-8')); - const dirs = path.dirname(jsonFile).split('/').filter(d => d !== '.'); + const dirs = path.dirname(jsonFile).split(path.sep).filter(d => d !== '.'); const fileKey = fileName.replace(/-/g, ' ') .split(' ') @@ -371,11 +374,8 @@ async function createMetaFilesForAllFolders() { }; } - const metaDataPath = path.join(sectionPath, '_meta.json'); - if (!existsSync(metaDataPath)) { - await writeFile(metaDataPath, JSON.stringify(meta, null, 2)); - console.log(`Created meta file: ${metaDataPath}`); - } + await writeFile(metaPath, JSON.stringify(meta, null, 2)); + console.log(`Created/Updated meta file: ${metaPath}`); } } } catch (error) {