Skip to content

Commit

Permalink
apply actionable commet
Browse files Browse the repository at this point in the history
  • Loading branch information
vishvamsinh28 committed Dec 18, 2024
1 parent a795ce0 commit 8f00a15
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/build-post-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 8f00a15

Please sign in to comment.