mirror of
https://github.com/github/awesome-copilot.git
synced 2026-03-13 20:55:13 +00:00
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -6,13 +6,23 @@ import { fundamentalsOrder, referenceOrder } from '../../config/learning-hub';
|
||||
const base = import.meta.env.BASE_URL;
|
||||
const articles = await getCollection('learning-hub');
|
||||
|
||||
const fundamentalsOrderIndex = {};
|
||||
fundamentalsOrder.forEach((id, index) => {
|
||||
fundamentalsOrderIndex[id] = index;
|
||||
});
|
||||
|
||||
const referenceOrderIndex = {};
|
||||
referenceOrder.forEach((id, index) => {
|
||||
referenceOrderIndex[id] = index;
|
||||
});
|
||||
|
||||
const fundamentals = articles
|
||||
.filter((a) => fundamentalsOrder.includes(a.id))
|
||||
.sort((a, b) => fundamentalsOrder.indexOf(a.id) - fundamentalsOrder.indexOf(b.id));
|
||||
.sort((a, b) => fundamentalsOrderIndex[a.id] - fundamentalsOrderIndex[b.id]);
|
||||
|
||||
const reference = articles
|
||||
.filter((a) => referenceOrder.includes(a.id))
|
||||
.sort((a, b) => referenceOrder.indexOf(a.id) - referenceOrder.indexOf(b.id));
|
||||
.sort((a, b) => referenceOrderIndex[a.id] - referenceOrderIndex[b.id]);
|
||||
---
|
||||
|
||||
<BaseLayout title="Learning Hub" description="Curated articles and walkthroughs to help you unlock everything you can do with GitHub Copilot" activeNav="learning-hub">
|
||||
|
||||
Reference in New Issue
Block a user