Add portafolio page

This commit is contained in:
Alexander Navarro 2023-11-18 14:02:51 -03:00
parent 0c10c3fa77
commit 318a647147
8 changed files with 166 additions and 23 deletions

View file

@ -5,7 +5,15 @@ import Card from '../components/Card.astro';
import { Image } from 'astro:assets';
import portrait from '../assets/images/portrait.jpg';
const games = await getCollection('games', (_, idx) => idx < 3);
const games = await getCollection('games');
const blog = await getCollection('blog', ({ data }) =>
import.meta.env.PROD ? data.draft !== true : true,
);
// TODO: show the pinned ones, not the recents
const portafolio = await getCollection('portafolio', ({ data }) =>
import.meta.env.PROD ? data.draft !== true : true,
);
---
<Layout title="aleidk">
@ -34,29 +42,29 @@ const games = await getCollection('games', (_, idx) => idx < 3);
<Card>
<h3 slot="title">Portafolio</h3>
<ul>
<li><a href="">This is a project X</a></li>
<li><a href="">This is a project Y</a></li>
<li><a href="">This is a project Z</a></li>
{
portafolio.slice(0, 3).map((item) => (
<li>
<a href={`portafolio/${item.slug}`}>{item.data.title}</a>
</li>
))
}
</ul>
<div slot="footer" class="text-end">
<a href="">See more...</a>
<a href="/portafolio">See more...</a>
</div>
</Card>
<Card>
<h3 slot="title">Blog</h3>
<ul>
<li><a href="">How I do X thing because I wanted</a></li>
<li>
<a href=""
>The day I discover something marvelous and everything was better</a
>
</li>
<li>
<a href=""
>This is a clickbait title trying to make you enter this article</a
>
</li>
{
blog.slice(0, 3).map((item) => (
<li>
<a href={`blog/${item.slug}`}>{item.data.title}</a>
</li>
))
}
</ul>
<div slot="footer" class="text-end">
<a href="/blog">See more...</a>
@ -67,7 +75,7 @@ const games = await getCollection('games', (_, idx) => idx < 3);
<h3 slot="title">Games</h3>
<ul>
{
games.map((item) => (
games.slice(0, 3).map((item) => (
<li>
<a href={`games/${item.slug}`}>{item.data.title}</a>
</li>