people order no longer alphabetical
This commit is contained in:
@@ -30,16 +30,59 @@ function getPeopleComponents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Function to generate the peopleData.ts content
|
// 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) {
|
function generatePeopleDataContent(components) {
|
||||||
const imports = components
|
const sortedComponents = sortComponents(components)
|
||||||
|
|
||||||
|
const imports = sortedComponents
|
||||||
.map(comp => `import { data as ${comp.importName}Data } from '${comp.importPath}'`)
|
.map(comp => `import { data as ${comp.importName}Data } from '${comp.importPath}'`)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
|
|
||||||
const dynamicImports = components
|
const dynamicImports = sortedComponents
|
||||||
.map(comp => ` () => import('${comp.importPath}'),`)
|
.map(comp => ` () => import('${comp.importPath}'),`)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
|
|
||||||
const syncDataPush = components
|
const syncDataPush = sortedComponents
|
||||||
.map(comp => `
|
.map(comp => `
|
||||||
try {
|
try {
|
||||||
allPeopleData.push(...${comp.importName}Data)
|
allPeopleData.push(...${comp.importName}Data)
|
||||||
|
|||||||
@@ -17,16 +17,15 @@ export async function getAllPeopleData(): Promise<PersonData[]> {
|
|||||||
|
|
||||||
// Auto-generated list of all people components
|
// Auto-generated list of all people components
|
||||||
const peopleComponents = [
|
const peopleComponents = [
|
||||||
|
() => import('@/components/people/People_Kristof_de_Spiegeleer'),
|
||||||
() => import('@/components/people/People_Adnan_Fateryji'),
|
() => import('@/components/people/People_Adnan_Fateryji'),
|
||||||
() => import('@/components/people/People_Alexandre_Hannelas'),
|
|
||||||
() => import('@/components/people/People_Chris_Camponovo'),
|
() => import('@/components/people/People_Chris_Camponovo'),
|
||||||
() => import('@/components/people/People_Emre_Koc'),
|
|
||||||
() => import('@/components/people/People_Florian_Fournier'),
|
() => import('@/components/people/People_Florian_Fournier'),
|
||||||
|
() => import('@/components/people/People_Alexandre_Hannelas'),
|
||||||
() => import('@/components/people/People_Gregory_Flipo'),
|
() => import('@/components/people/People_Gregory_Flipo'),
|
||||||
() => import('@/components/people/People_Hugo_Mathecowitsch'),
|
() => import('@/components/people/People_Hugo_Mathecowitsch'),
|
||||||
() => import('@/components/people/People_Jan_De_Landtsheer'),
|
() => import('@/components/people/People_Jan_De_Landtsheer'),
|
||||||
() => import('@/components/people/People_Karoline_Zizka'),
|
() => import('@/components/people/People_Karoline_Zizka'),
|
||||||
() => import('@/components/people/People_Kristof_de_Spiegeleer'),
|
|
||||||
() => import('@/components/people/People_Malte_Geierhos'),
|
() => import('@/components/people/People_Malte_Geierhos'),
|
||||||
() => import('@/components/people/People_Marion_Ravarino'),
|
() => import('@/components/people/People_Marion_Ravarino'),
|
||||||
() => import('@/components/people/People_Michel_Coucke'),
|
() => import('@/components/people/People_Michel_Coucke'),
|
||||||
@@ -36,6 +35,7 @@ export async function getAllPeopleData(): Promise<PersonData[]> {
|
|||||||
() => import('@/components/people/People_Sam_Taggart'),
|
() => import('@/components/people/People_Sam_Taggart'),
|
||||||
() => import('@/components/people/People_Sasha_Astiadi'),
|
() => import('@/components/people/People_Sasha_Astiadi'),
|
||||||
() => import('@/components/people/People_Timur_Gordon'),
|
() => import('@/components/people/People_Timur_Gordon'),
|
||||||
|
() => import('@/components/people/People_Emre_Koc'),
|
||||||
() => import('@/components/people/People_Vianney_Spriet'),
|
() => import('@/components/people/People_Vianney_Spriet'),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -54,16 +54,15 @@ export async function getAllPeopleData(): Promise<PersonData[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Synchronous version using static imports for immediate data access
|
// Synchronous version using static imports for immediate data access
|
||||||
|
import { data as kristof_de_spiegeleerData } from '@/components/people/People_Kristof_de_Spiegeleer'
|
||||||
import { data as adnan_fateryjiData } from '@/components/people/People_Adnan_Fateryji'
|
import { data as adnan_fateryjiData } from '@/components/people/People_Adnan_Fateryji'
|
||||||
import { data as alexandre_hannelasData } from '@/components/people/People_Alexandre_Hannelas'
|
|
||||||
import { data as chris_camponovoData } from '@/components/people/People_Chris_Camponovo'
|
import { data as chris_camponovoData } from '@/components/people/People_Chris_Camponovo'
|
||||||
import { data as emre_kocData } from '@/components/people/People_Emre_Koc'
|
|
||||||
import { data as florian_fournierData } from '@/components/people/People_Florian_Fournier'
|
import { data as florian_fournierData } from '@/components/people/People_Florian_Fournier'
|
||||||
|
import { data as alexandre_hannelasData } from '@/components/people/People_Alexandre_Hannelas'
|
||||||
import { data as gregory_flipoData } from '@/components/people/People_Gregory_Flipo'
|
import { data as gregory_flipoData } from '@/components/people/People_Gregory_Flipo'
|
||||||
import { data as hugo_mathecowitschData } from '@/components/people/People_Hugo_Mathecowitsch'
|
import { data as hugo_mathecowitschData } from '@/components/people/People_Hugo_Mathecowitsch'
|
||||||
import { data as jan_de_landtsheerData } from '@/components/people/People_Jan_De_Landtsheer'
|
import { data as jan_de_landtsheerData } from '@/components/people/People_Jan_De_Landtsheer'
|
||||||
import { data as karoline_zizkaData } from '@/components/people/People_Karoline_Zizka'
|
import { data as karoline_zizkaData } from '@/components/people/People_Karoline_Zizka'
|
||||||
import { data as kristof_de_spiegeleerData } from '@/components/people/People_Kristof_de_Spiegeleer'
|
|
||||||
import { data as malte_geierhosData } from '@/components/people/People_Malte_Geierhos'
|
import { data as malte_geierhosData } from '@/components/people/People_Malte_Geierhos'
|
||||||
import { data as marion_ravarinoData } from '@/components/people/People_Marion_Ravarino'
|
import { data as marion_ravarinoData } from '@/components/people/People_Marion_Ravarino'
|
||||||
import { data as michel_couckeData } from '@/components/people/People_Michel_Coucke'
|
import { data as michel_couckeData } from '@/components/people/People_Michel_Coucke'
|
||||||
@@ -73,6 +72,7 @@ import { data as sacha_obeegadooData } from '@/components/people/People_Sacha_Ob
|
|||||||
import { data as sam_taggartData } from '@/components/people/People_Sam_Taggart'
|
import { data as sam_taggartData } from '@/components/people/People_Sam_Taggart'
|
||||||
import { data as sasha_astiadiData } from '@/components/people/People_Sasha_Astiadi'
|
import { data as sasha_astiadiData } from '@/components/people/People_Sasha_Astiadi'
|
||||||
import { data as timur_gordonData } from '@/components/people/People_Timur_Gordon'
|
import { data as timur_gordonData } from '@/components/people/People_Timur_Gordon'
|
||||||
|
import { data as emre_kocData } from '@/components/people/People_Emre_Koc'
|
||||||
import { data as vianney_sprietData } from '@/components/people/People_Vianney_Spriet'
|
import { data as vianney_sprietData } from '@/components/people/People_Vianney_Spriet'
|
||||||
|
|
||||||
export function getAllPeopleDataSync(): PersonData[] {
|
export function getAllPeopleDataSync(): PersonData[] {
|
||||||
@@ -107,7 +107,7 @@ export function getAllPeopleDataSync(): PersonData[] {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error loading alexandre_hannelas data:', error)
|
console.error('Error loading alexandre_hannelas data:', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
allPeopleData.push(...gregory_flipoData)
|
allPeopleData.push(...gregory_flipoData)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user