feat(pages): sort projects by alphabet

This commit is contained in:
xHyroM 2023-04-01 10:28:22 +02:00
parent 00325005cc
commit e634f07d3e
No known key found for this signature in database
GPG key ID: BE0423F386C436AA

View file

@ -10,7 +10,6 @@ interface Project {
stats?: {
forks: number;
stars: number;
updated_at: Date;
};
}
@ -99,13 +98,10 @@ for (const project of projects) {
project.stats = {
forks: repository.forks,
stars: repository.stargazers_count,
updated_at: new Date(repository.updated_at),
};
}
projects.sort(
(a, b) => b.stats!.updated_at.getTime() - a.stats!.updated_at.getTime()
);
projects.sort((a, b) => a.name.localeCompare(b.name));
---
<Layout