Skip to content

Commit

Permalink
sort people by eips
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtree committed Oct 24, 2023
1 parent f8a2b06 commit df27980
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/src/components/ItemList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
import { config } from '../config.js';
const { bundle, cat } = Astro.props;
const catData = config.categories.find(c => c.col === cat)
let catData = config.categories.find(c => c.col === cat)
let items = bundle.data[cat]
if (cat === 'people') {
items = items.sort((x, y) => (x.eips?.length || 0) > (y.eips?.length || 0) ? -1 : 1 )
}
---

<div>
<h1 class="text-2xl mb-10">{catData.name}</h1>

<div class="">
{bundle.data[cat].map((item) => (
{items.map((item) => (
<div class="border p-3 mb-4">
<div class="text-lg">
<a href={`/${item.slug}`} class="hover:underline">{item.name}</a>
Expand Down

0 comments on commit df27980

Please sign in to comment.