people order no longer alphabetical
This commit is contained in:
@@ -30,16 +30,59 @@ function getPeopleComponents() {
|
||||
}
|
||||
|
||||
// Function to generate the peopleData.ts content
|
||||
function sortComponents(components) {
|
||||
const manualOrder = [
|
||||
'People_Kristof_de_Spiegeleer',
|
||||
'People_Adnan_Fateryji',
|
||||
'People_Chris_Camponovo',
|
||||
'People_Florian_Fournier',
|
||||
'People_Alexandre_Hannelas',
|
||||
'People_Gregory_Flipo',
|
||||
'People_Hugo_Mathecowitsch',
|
||||
'People_Jan_De_Landtsheer',
|
||||
'People_Karoline_Zizka',
|
||||
'People_Malte_Geierhos',
|
||||
'People_Marion_Ravarino',
|
||||
'People_Michel_Coucke',
|
||||
'People_Nousrath_Bhugeloo',
|
||||
'People_Owen_Kemp',
|
||||
'People_Sacha_Obeegadoo',
|
||||
'People_Sam_Taggart',
|
||||
'People_Sasha_Astiadi',
|
||||
'People_Timur_Gordon',
|
||||
'People_Emre_Koc',
|
||||
'People_Vianney_Spriet'
|
||||
]
|
||||
|
||||
return components
|
||||
.map(component => {
|
||||
const orderIndex = manualOrder.indexOf(component.componentName)
|
||||
return {
|
||||
...component,
|
||||
orderIndex: orderIndex === -1 ? Number.MAX_SAFE_INTEGER : orderIndex
|
||||
}
|
||||
})
|
||||
.sort((a, b) => {
|
||||
if (a.orderIndex !== b.orderIndex) {
|
||||
return a.orderIndex - b.orderIndex
|
||||
}
|
||||
// Fallback to alphabetical ordering for any components not listed
|
||||
return a.componentName.localeCompare(b.componentName)
|
||||
})
|
||||
}
|
||||
|
||||
function generatePeopleDataContent(components) {
|
||||
const imports = components
|
||||
const sortedComponents = sortComponents(components)
|
||||
|
||||
const imports = sortedComponents
|
||||
.map(comp => `import { data as ${comp.importName}Data } from '${comp.importPath}'`)
|
||||
.join('\n')
|
||||
|
||||
const dynamicImports = components
|
||||
const dynamicImports = sortedComponents
|
||||
.map(comp => ` () => import('${comp.importPath}'),`)
|
||||
.join('\n')
|
||||
|
||||
const syncDataPush = components
|
||||
const syncDataPush = sortedComponents
|
||||
.map(comp => `
|
||||
try {
|
||||
allPeopleData.push(...${comp.importName}Data)
|
||||
|
||||
Reference in New Issue
Block a user