From 8f00a15fe2630e970179ac8a0dc159eb6a66d10c Mon Sep 17 00:00:00 2001 From: Vishvamsinh Vaghela Date: Wed, 18 Dec 2024 11:55:28 +0530 Subject: [PATCH] apply actionable commet --- scripts/build-post-list.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build-post-list.js b/scripts/build-post-list.js index 8cba75c33af9..33acdaad9bad 100644 --- a/scripts/build-post-list.js +++ b/scripts/build-post-list.js @@ -27,14 +27,14 @@ const addItem = (details) => { } }; -function getVersionDetails(slug) { +function getVersionDetails(slug, weight) { const fileBaseName = basename(slug); const versionName = fileBaseName.split('-')[0]; return { - title: versionName.startsWith('v') ? - capitalize(versionName.slice(1)) : - capitalize(versionName), - weight: specWeight-- + title: versionName.startsWith('v') + ? capitalize(versionName.slice(1)) + : capitalize(versionName), + weight }; } @@ -134,7 +134,7 @@ async function walkDirectories( details.slug = details.isIndex ? sectionSlug : slug.replace(/\.mdx$/, '') if (details.slug.includes('/reference/specification/') && !details.title) { const fileBaseName = basename(details.slug) - const versionDetails = getVersionDetails(details.slug); + const versionDetails = getVersionDetails(details.slug, specWeight--); details.title = versionDetails.title; details.weight = versionDetails.weight;