lib\reviews.js
export async function getReviews() {
const slugs = await getSlugs();
const reviews = [];
for (const slug of slugs) {
const review = await getReview(slug);
reviews.push(review);
}
// 排序 舊->新
// reviews.sort((a, b) => a.date.localeCompare(b.date));
// 排序 新->舊
reviews.sort((a, b) => b.date.localeCompare(a.date));
return reviews;
}
ps:今天又碰到大停電,從早上4點到下午6點...
大叔的鐵人賽第十六天結束 :)