content collections for badges and projects
This commit is contained in:
parent
b09fe1b8bf
commit
49562a82a4
28 changed files with 131 additions and 61 deletions
|
@ -1,21 +1,13 @@
|
|||
---
|
||||
interface Props {
|
||||
projects: {
|
||||
name: string,
|
||||
description: string,
|
||||
date: Date,
|
||||
dateVisual?: string,
|
||||
links: string[]
|
||||
}[]
|
||||
}
|
||||
import { getEntry } from "astro:content";
|
||||
|
||||
const { projects } = Astro.props;
|
||||
const projects = await getEntry("projects", "projects");
|
||||
|
||||
let lastYear = 0;
|
||||
---
|
||||
|
||||
<div>
|
||||
{projects.sort((a, b) => b.date.getTime() - a.date.getTime()).map((project) => {
|
||||
{projects.data.sort((a, b) => b.date.getTime() - a.date.getTime()).map((project) => {
|
||||
const isNewYear = project.date.getFullYear() !== lastYear;
|
||||
lastYear = project.date.getFullYear();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue