Skip to content

Commit

Permalink
website: improve transformApiFolder.js, add fallback title
Browse files Browse the repository at this point in the history
Signed-off-by: Mehdi Nassim KHODJA <18899702+naskio@users.noreply.github.com>
  • Loading branch information
naskio committed Dec 6, 2024
1 parent aed1704 commit 7b35f93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/scripts/transformApiFolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function transformApiReferenceFolder(relativePath) {

// Update content
const updatedContent = updateFileContent(file, fs.readFileSync(filePath, 'utf-8'), navigation);
const frontMatter = `---\ntitle: "${extractTitleFromContent(updatedContent)}"\nsidebar_position: ${fileNavigation.sidebar_position}\n---\n\n`;
const frontMatter = `---\ntitle: "${extractTitleFromContent(updatedContent) || fileNavigation.title}"\nsidebar_position: ${fileNavigation.sidebar_position}\n---\n\n`;

// Prepare new file
const newPath = path.join(folderPath, fileNavigation.href);
Expand Down

0 comments on commit 7b35f93

Please sign in to comment.