mirror of
https://github.com/github/awesome-copilot.git
synced 2026-03-12 04:05:12 +00:00
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -54,7 +54,11 @@ const currentSlug = Astro.url.pathname.replace(/\/$/, '').split('/').pop();
|
||||
<h1>{title}</h1>
|
||||
{description && <p>{description}</p>}
|
||||
<div class="article-meta">
|
||||
{estimatedReadingTime && <span class="meta-item">📖 {estimatedReadingTime}</span>}
|
||||
{estimatedReadingTime && (
|
||||
<span class="meta-item">
|
||||
<span aria-hidden="true">📖</span> {estimatedReadingTime}
|
||||
</span>
|
||||
)}
|
||||
{lastUpdated && <span class="meta-item">Updated: {lastUpdated}</span>}
|
||||
</div>
|
||||
{tags && tags.length > 0 && (
|
||||
|
||||
@@ -6,23 +6,24 @@ 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 createOrderIndexMap = (order) => {
|
||||
const map = new Map();
|
||||
order.forEach((id, index) => {
|
||||
map.set(id, index);
|
||||
});
|
||||
return map;
|
||||
};
|
||||
|
||||
const referenceOrderIndex = {};
|
||||
referenceOrder.forEach((id, index) => {
|
||||
referenceOrderIndex[id] = index;
|
||||
});
|
||||
const fundamentalsOrderIndex = createOrderIndexMap(fundamentalsOrder);
|
||||
const referenceOrderIndex = createOrderIndexMap(referenceOrder);
|
||||
|
||||
const fundamentals = articles
|
||||
.filter((a) => fundamentalsOrder.includes(a.id))
|
||||
.sort((a, b) => fundamentalsOrderIndex[a.id] - fundamentalsOrderIndex[b.id]);
|
||||
.sort((a, b) => fundamentalsOrderIndex.get(a.id) - fundamentalsOrderIndex.get(b.id));
|
||||
|
||||
const reference = articles
|
||||
.filter((a) => referenceOrder.includes(a.id))
|
||||
.sort((a, b) => referenceOrderIndex[a.id] - referenceOrderIndex[b.id]);
|
||||
.sort((a, b) => referenceOrderIndex.get(a.id) - referenceOrderIndex.get(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